Multiple choice technology programming languages

What does this program do ? public class Null { public static void greet() { System.out.println("Hello world!"); } public static void main(String[] args) { ((Null) null).greet(); } }

  1. Hello world!

  2. Throw a NullPointerException

  3. Won't even compile

  4. Run time error

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

Static methods in Java can be called on a null reference without throwing NullPointerException. The JVM resolves the method call based on the declared type (Null class), not the actual object reference (null). This is a subtle Java behavior often tested in interviews.