Home > Java Programming > Inner Classes > Questions and Answers
Q: |
What is the output for the below code ? public class Outer { private int a = 7; class Inner { public void displayValue() { System.out.println("Value of a is " + a); } } } public class Test { public static void main(String... args) throws Exception { Outer mo = new Outer(); Outer.Inner inner = mo.new Inner(); inner.displayValue(); } } | ||||||||||
|
Comment on this Question | |
Name: | |
|