What Will Be The Output Of The Following Java Code P Pre #867

What will be the output of the following Java code? </p> <pre><code class="language-java"> import java.lang.Math; class A { int a=9; } class B extends A { public void Y() { System.out.println(Math.sqrt(a)); } } class C extends A { public void Z() { System.out.println(Math.pow(a,2)); } } public class Power { public static void main(String[] args) { B obj1 = new B(); C obj2 = new C(); obj1.Y(); obj2.Z(); } } </code></pre>

Online Quiz 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) - Hierarchical Inheritance - Quiz No.2.


Similar question(s) are as followings:



Online Quizzes of gs111 OOP Object Oriented Programming Java

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background