Question: * Question Completion Status: Question 1 Output of following Java Program? class Base { public void show() { System.out.println(Base::show() called); } } class Derived extends

 * Question Completion Status: Question 1 Output of following Java Program?
class Base { public void show() { System.out.println("Base::show() called"); } } class
Derived extends Base { public void show() { System.out.println("Derived::show() called"); } }
public class Main { public static void main(String[] args) { Base b
= new Derived) ;; b.show(); } } Derivedi show called Base show)

* Question Completion Status: Question 1 Output of following Java Program? class Base { public void show() { System.out.println("Base::show() called"); } } class Derived extends Base { public void show() { System.out.println("Derived::show() called"); } } public class Main { public static void main(String[] args) { Base b = new Derived) ;; b.show(); } } Derivedi show called Base show) called Error No output Type here to search ki Question Completion Status: > Click Submit to complete this assessment. Question 10 Which of the following is correct syntax for defining a new class folt based on the superclass SoftDrink? O class Jolt isa SoftDrink { //additional definitions go here) class folt implements SoftDrink { //additional definitions go here ) class Jolt defines SoftDrink { //additional definitions go here) class Jolt extends SoftDrink { //additional definitions go here ) A Click Submit to complete this assessment. What will be the output of the following Java program? class A { int i; } class B extends A { int j; void display() { super.i - j + 1; System.out.println(j + 3 3 class inheritance + i); public static void main(String args[]) { B obj = new B) obj. i=1; objj-2 obj.display 022 33 What will be the output of the following Java program? class A { int i; void display) { System.out.println(i); class B extends A int i; void display) { System.out.println(j); } class inheritance_demo { public static void main(String args[]) B obj - new BO: obj.1-2; obj.1-2; obj.display(); Type here to search . Remaining Time: 28 minutes, 13 seconds. * Question Completion Status: What will be the output of the following Java program? class A { public int i; public int : AO { i = 1; j = 2; } 3 class B extends A { int a BO { super(); 3 class super_use public static void main(String args[]); B. obj new BO; System.out.println(obj. 03:32 EL Type here to search

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!