rahulchand
Right off the assembly line
as you know java doesn't allow the use of super keyword inside a static method,is their any way to access the data member of super class having same name and type as that of a local data member in main method without creating an object reference.
class A
{
static int x=10;//access to 10 without object reference
}
class B extends A
{
public static void main(String []rc)
{
int x=11;
System.out.println("--"+x);//prints 11
}
}
class A
{
static int x=10;//access to 10 without object reference
}
class B extends A
{
public static void main(String []rc)
{
int x=11;
System.out.println("--"+x);//prints 11
}
}