Given the fragment: What is the result?
A.
An exception is thrown at runtime
B.
Compilation fails
C.
13480.0
D.
13480.02
Explanation:
Given the fragment: What is the result?
Given the fragment: What is the result?
A.
An exception is thrown at runtime
B.
Compilation fails
C.
13480.0
D.
13480.02
Explanation:
Answer: C
Code question:
public class Main {
public static void main(String[] args) {
float var1 = (12_345.01 >= 123_45.00) ? 12_456 : 124_56.02f;
float var2 = var1 + 1024;
System.out.println(var2);
}
}
Output:
13480.0