I am a beginner in java. Here is my code
class Super{
public int a;
}
class sub extends Super{
int a = 10;
}
public class test{
public static void main(String args[]){
Super var = new sub();
System.out.println(var.a);//Here I want to print 10 , value of sub class
}
}
Is it possible and if it is then please tell me how? And I having some problem with the title of this question, so please suggest me an appropriate one as i had explained everything what i want in my code.