Title: What is the output of the following code? public class Inherit{abstract class Figure{void ... Post by: Stromile on Apr 30, 2018 What is the output of the following code?
public class Inherit { abstract class Figure { void display() { System.out.println("Figure"); } } class Line extends Figure { void display() { System.out.println("Line"); } } void tryme(Figure f) { f.display(); } Inherit() { Figure f = new Line(); tryme(f); } public static void main(String[] args) { new Inherit(); } } a. Line b. Figure c. Shape d. Syntax error; this code won't compile e. None of these Title: Re: What is the output of the following code? public class Inherit{abstract class Figure{void ... Post by: Stinger on Apr 30, 2018 Content hidden
|