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 Proj12.java
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 Proj12{
public static void main(String[] args){
Proj12Runner var = new Proj12Runner();
System.out.println("=====This line is required=====");
Animal cat = new Cat();
System.out.println(cat.speak());
Animal dog = new Dog();
System.out.println(dog.speak());
Animal cow = new Cow();
System.out.println(cow.speak());
}//end main
}//end class Proj12
//===============================================//
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 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!