Answer:
see explaination for program code
Explanation:
interface Runner
{
public abstract void run();
}
class Machine implements Runner
{
public void run()
{
System.out.println("Machine is running");
}
}
class Athlete implements Runner
{
public void run()
{
System.out.println("Athlete is running");
}
}
class PoliticalCandidate implements Runner
{
public void run()
{
System.out.println("Political Candidate is running");
}
}
class DemoRunners
{
public static void main (String[] args)
{
Machine m = new Machine();
m.run();
Athlete a = new Athlete();
a.run();
PoliticalCandidate pc = new PoliticalCandidate();
pc.run();
}
}
Answer:
File History utility and System Protection utility for windows 8;
And then Backup and Restore utility and System Protection utility for windows 7.
Answer:
a. Object cannot be converted to Person
Explanation:
This program demonstrates polymorphism.
e.g., a Student IS a Person therefore you can call m() with a Student as well as a Person object.
The same goes for GraduateStudent.
However, and Object is not a Person, so the last call fails. This can be deducted by the type checking that happens at compile time.