Skip to content

Instantly share code, notes, and snippets.

@ProZhar
Created December 6, 2015 17:48
Show Gist options
  • Select an option

  • Save ProZhar/c8c558a10cc0dc89bbce to your computer and use it in GitHub Desktop.

Select an option

Save ProZhar/c8c558a10cc0dc89bbce to your computer and use it in GitHub Desktop.
com.javarush.test.level10.lesson04.task01
package com.javarush.test.level10.lesson04.task01;
/* Задача №1 на преобразование целых типов
Расставьте правильно операторы приведения типа, чтобы получился ответ: d > 0
int a = 0;
int b = (byte) a + 46;
byte c = (byte) (a*b);
double f = (char) 1234.15;
long d = (short) (a + f / c + b);
*/
public class Solution
{
public static void main(String[] args)
{
int a = 0;
int b = (byte) a + 46;
byte c = (byte) (a*b);
double f = (char) 1234.15;
long d = (char) (a + f / c + b);
System.out.println(d);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment