Created
December 6, 2015 17:48
-
-
Save ProZhar/c8c558a10cc0dc89bbce to your computer and use it in GitHub Desktop.
com.javarush.test.level10.lesson04.task01
This file contains hidden or 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.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