L & P Solutions interview question

What will this code do? ``` public class A { private int a = 0; public static int met() { return a++; } } ```

Interview Answer

Anonymous

28 Jun 2024

It will produce a compile time error because a static method is not allowed to reference an instance variable.