I have the following code
public class Test {
static String mountain = "Everest";
static Test favorite() {
System.out.print("Mount ");
return null;
}
public static void main(String[] args) {
System.out.println(favorite().mountain);
}
}
I thought it would raise a NPE but it is giving Mount Everest as output can anyone clarify?