What Will Be The Output Of The Following Java Codep Pre #634
What will be the output of the following Java code?</p> <pre><code class="language-java"> class Outer { protected int x = 10; class Inner { final int y = 15; } } class Final { public static void main(String[] args) { Outer myOuter = new Outer(); Outer.Inner myInner = myOuter.new Inner(); System.out.println(myInner.y + myOuter.x); } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs111 OOP Object Oriented Programming Java. It can also be found in gs gs111 Types of Classes (Using Java) - Inner Class - Quiz No.1.