Question: Which method call can be inserted at both (1) and (2), so that the following code will still compile? Select the one correct answer. (a)
Which method call can be inserted at both (1) and (2), so that the following code will still compile?

Select the one correct answer.
(a) printSlogan();
(b) co.printSlogan();
(c) sl.printSlogan();
(d) Firm.printSlogan();
(e) INewSlogan.printSlogan();
// File : Firm.java interface INewSlogan { } // String SLOGAN = "Trouble shared is trouble halved!"; static void printslogan () { System.out.println (SLOGAN) ; } public class Firm implements INewSlogan { public static void main (String [] args) { Firm co new Firm (); INewSlogan sl = co; // (1) INSERT THE STATEMENT EXPRESSION HERE. } void testslogan () { Firm co = new Firm(); INewSlogan s1 = co; // (2) INSERT THE STATEMENT EXPRESSION HERE.
Step by Step Solution
3.40 Rating (150 Votes )
There are 3 Steps involved in it
e The static method printSlogan is not inherit... View full answer
Get step-by-step solutions from verified subject matter experts
