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
Can constructor return value?
Can we use switch statement with strings?
Can we override the private methods?
What is the difference between and ?
Difference between class#getinstance() and new operator ?
What are the procedures?
Define linked list and its features with signature?
Can a constructor be made final?
Why do we need strings in java?
What is the program compilation process?
how to create daemon thread in java?
Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?
What is basic syntax?
What is a jit compiler?
What are the types of arrays in java?