Answer Posted / jettimadhuchowdary
public class MainTest {
private int localPr =1;
public int localPb = 20;
protected int localPro = 3;
int localDf = 5;
/**
* @param args
*/
public static void main(String[] s) {
// TODO Auto-generated method stub
MainTest mainTest = new MainTest();
InnerClass class1 = mainTest.new InnerClass();
class1.call();
}
class InnerClass
{
void call() {
System.out.println(" display data localDf ="+ localDf);
System.out.println(" display data localPro ="+ localPro);
System.out.println(" display data localPb ="+ localPb);
System.out.println(" display data localPr ="+ localPr);
}
}
}
and the output is
display data localDf =5
display data localPro =3
display data localPb =20
display data localPr =1
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
What is the difference between compile-time polymorphism and runtime polymorphism?
How do you override a method?
java Technical questions asked by JPMC
What is the public method modifier?
Can extern variables be initialized?
How to use Media tracker Class.
What is a dynamic array in java?
Why runnable interface is used in java?
What does || || mean in math?
Is void a return type?
Can private members of a base class are inheritable justify?
Why object class is super class for every class in java?
how come we know the object is no more used in the class?