What Will Be The Output Of The Following Java Codep Pre #874
What will be the output of the following Java code?</p> <pre><code class="language-java"> class A { public void disp() { System.out.println("Rank 1"); } } class B extends A { public void disp() { System.out.println("Rank 2"); } } class C extends A { public void disp() { System.out.println("Rank 3"); } } public class Hybrid3 extends C { public void disp() { System.out.println("Rank 4"); } public static void main(String args[]) { Hybrid3 obj = new Hybrid3(); obj.disp(); } }</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 Inheritance (Using Java) - Hybrid Inheritance - Quiz No.1.