Consider the following code snippet:
|
1 2 3 |
if (i == 15.0) { System.out.println("true"); } |
Which one of the following declarations of the variable i will compile without errors and print true when the program runs?
- int i = 017;
- int i = 15.0f;
- int i = 15L;
- int i = 15.0;
I will comment out the solution in the next few hours. Stay tunned.