What Will Be The Output Of The Following Java Codep Pre #911
What will be the output of the following Java code?</p> <pre><code class="language-java"> class Base { public void position() { String s = "NVAEducation"; System.out.println(s.charAt(3)); } } class Derived extends Base { public void position() { String s = "JAVA"; System.out.print(s.charAt(2)); } } public class Position { public static void main(String[] args) { Base i = new Derived(); i.position(); } }</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 Polymorphism (Using Java) - Method Overriding - Quiz No.2.