I am currently in the design mode for this problem:
Implement the Speaker interface that is predefined. Create three classes that implement Speaker in various ways. Create a driver class whose main method instantiates some of these objects and tests their abilities.
How would I go about designing this program and them moving into the coding stage. I want to use these three classes to implement the Speaker interface class: Politician, Lecturer, and Pastor class. The methods I want to use are:
public void speak();
public void announce (String str);
Now for my design and coding, how would I go about to declare and object reference variable and have that variable have multiple references?
See “What is an Interface?” http://docs.oracle.com/javase/tutorial/java/concepts/interface.html This will hopefully get you started with the basics you’re looking for.
The start of the implementation would look something like the following…