Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Size and signedness of Java ints and longs
//Title of this code //'main' method must be in a class 'Rextester'. import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int zero = 0; int one = 1; int minusone = -1; int effeff = 0xffffffff; //int effeffell = 0xffffffffL; // Gives: // source_file.java:15: possible loss of precision // found : long // required: int // int effeffell = 0xffffffffL; // ^ long longeffeffell = 0xffffffffL; System.out.println("zero = " + zero); System.out.println("one = " + one); System.out.println("minusone = " + minusone); System.out.println("effeff = " + effeff); //System.out.println("effeffell = " + effeffell); System.out.println("longeffeffell = " + longeffeffell); System.out.println("effeff < 0 = " + (effeff < 0)); System.out.println("effeff < zero = " + (effeff < zero)); //System.out.println("effeffell < 0 = " + (effeffell < 0)); //System.out.println("effeffell < zero = " + (effeffell < zero)); System.out.println("longeffeffell < 0 = " + (longeffeffell < 0)); System.out.println("longeffeffell < zero = " + (longeffeffell < zero)); } }
run
|
edit
|
history
|
help
0
arithematic
Count and Say
ArrayOperation
post decrement
Filter Iterator
Test
Bank System
bit right 2
Bubble Sort Java 2
JAVA # DİZİ İLE EN BÜYÜK BULMA