Multiple choice technology programming languages

What will be output of following code? package test; import java.lang.Math.PI; public class Main { public static void main(String[] args) { System.out.println(PI); } }

  1. 3.14

  2. Compile time error

  3. Run time error

  4. None of above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The code produces a compilation error because static import of java.lang.Math.PI is invalid syntax - PI is a static field but cannot be imported this way. The correct approach is either to use Math.PI directly or import the entire Math class statically. Options A, C, and D are incorrect.