In Ex16 we are not able to declare class JavaClass variable as static JavaClass obj(getting error msg - JavaClass cannot resolve to a type)however its working fine for Ex17 where the Class name is Ex17. Please explain the reason behind that.
Ex16--- public class Javaclass { static int i; static JavaClass obj; public static void main (String[] args) {
System.out.println(++i); //obj + "" +i);
} } Ex17--- public class Ex17 { static int i; static Ex17 obj; public static void main (String[] args) {
// Ex17 obj; int i=1; System.out.println(i);// obj + "" +i);