What will be the result of compiling and running the following program?
public class Main { public static void main(String[] args) { System.out.println(0x10 + 10 + 010); } }
Select the one correct answer.
(d)
0x10 is a hexadecimal literal equivalent to the decimal value 16.10 is a decimal literal.
010 is an octal literal equivalent to the decimal value 8.
The println()
method will print the sum of these values, which is 34, in decimal form.