Created
December 6, 2015 18:28
-
-
Save ProZhar/87241f32678cf6779c12 to your computer and use it in GitHub Desktop.
com.javarush.test.level10.lesson04.task05
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level10.lesson04.task05; | |
/* Задача №5 на преобразование целых типов | |
Расставьте правильно операторы приведения типа, чтобы получился ответ: c=256 | |
int a = (byte)44; | |
int b = (byte)300; | |
short c = (byte)(b - a); | |
*/ | |
public class Solution | |
{ | |
public static void main(String[] args) | |
{ | |
int a = (byte)44; | |
int b = (short)300; | |
short c = (short) (b - a); | |
System.out.println(c); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment