Study and understand each program. Use the three interfaces defined in CanSwim.j
ID: 3683767 • Letter: S
Question
Study and understand each program. Use the three interfaces defined in CanSwim.java to code a class for the implementation. Write a driver code to test your class. In a loop within the driver code prompt the user to (repeatedly) enter guesses until the correct guess is made. Terminate the loop and display the correct guess and greeting message. Save all code.
CanSwim.java
==================
public interface CanSwim {
void swim();
}
interface CanFly {
void fly();
}
interface CanWalk {
void walk();
}
=================
SomeOne.java
=================
//Demo: indirect multiple inheritance
abstract class Action {
public void doingList() {
System.out.println("Here is what I can do: ");
}
}
public class SomeOne extends Action implements CanSwim, CanFly, CanWalk {
public void swim() {
System.out.println("I can catch fish.");
}
public void fly() {
System.out.println("Sky is my limit.");
}
public void walk() {
System.out.println("I can even run.");
}
}
===========
MultipleInheritanceTest.java
=============
//Driver to test indirect multiple inheritance
public class MultipleInheritanceTest {
public static void main(String args[]) {
SomeOne guessWho = new SomeOne();
guessWho.doingList();
guessWho.swim();
guessWho.fly();
guessWho.walk();
System.out.println(" Who am I?");
}
}
Explanation / Answer
Hi friend, can you please tell me, what user has to guess ?? means what will be user input ??