Java Question abstract class A { public void templateMethod() { operation1 (); operation3 (); } abstract public void operation1 (); public void operation3() { System.out.print("A-op3"); } } Class B...


Java Question


abstract class A {


public void templateMethod() {


operation1 ();


operation3 ();


}


abstract public void operation1 ();


public void operation3() {


System.out.print("A-op3");


}


}


Class B extends A {


public void operation1() {


System.out.print("B-op1");


}


}


1.What is the output of:


B b1 = new B();


b1.operation1();


2.What is the output of:

A b1 = new B ();


a1.operation() ;


3.What is the output of :


A b1 = new B();


a1.templateMethod();



May 17, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here