Skip to content

Instantly share code, notes, and snippets.

@ProZhar
Created December 6, 2015 18:28
Show Gist options
  • Save ProZhar/87241f32678cf6779c12 to your computer and use it in GitHub Desktop.
Save ProZhar/87241f32678cf6779c12 to your computer and use it in GitHub Desktop.
com.javarush.test.level10.lesson04.task05
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