Question: / * File Proj 1 2 . java The purpose of this assignment is to assess the student's ability to write programs involving runtime polymorphism
File Projjava
The purpose of this assignment is to assess the student's
ability to write programs involving runtime polymorphism
based on interface inheritance.
Student must not modify the code in this file.
class Proj
public static void mainString args
ProjRunner var new ProjRunner;
System.out.printlnThis line is required;
Animal cat new Cat;
System.out.printlncatspeak;
Animal dog new Dog;
System.out.printlndogspeak;
Animal cow new Cow;
System.out.printlncowspeak;
end main
end class Proj
interface Animal
public String speak;
public void sleep;
public int run;
end interface
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
