Java Reference
In-Depth Information
// Print the value of test
System.out.println ("test = " + test);
// Print the maximum value of int type
System.out.println ("Maximum int = " + Integer.MAX_VALUE);
// Print the maximum value of double type
System.out.println ("Maximum double = " + Double.MAX_VALUE);
// Print the sum of two numbers
System.out.println ("12.5 + 100 = " + (12.5 + 100));
// Print the difference of two numbers
System.out.println ("12.5 - 100 = " + (12.5 - 100));
// Print the multiplication of two numbers
System.out.println ("12.5 * 100 = " + (12.5 * 100));
// Print the result of division
System.out.println ("12.5 / 100 = " + (12.5 / 100));
// Print the result of modulus
System.out.println ("12.5 % 100 = " + (12.5 % 100));
// Print the result of string concatenation
System.out.println ("\"abc\" + \"xyz\" = " + "\"" + ("abc" + "xyz") + "\"");
}
}
num = 120
realNum = 25.5
veryBigNum = Infinity
garbage = NaN
test = true
Maximum int = 2147483647
Maximum double = 1.7976931348623157E308
12.5 + 100 = 112.5
12.5 - 100 = -87.5
12.5 * 100 = 1250.0
12.5 / 100 = 0.125
12.5 % 100 = 12.5
"abc" + "xyz" = "abcxyz"
 
Search WWH ::




Custom Search