Starting from:

$29.99

Assignment #3  Implement the Speaker interface

Assignment #3
1)    Implement the Speaker interface described below and create three classes that implement Speaker in various ways.  Create a driver class whose main method instantiates some of these objects and test their abilities.
public interface Speaker {
  public void speak();
  public void announce( String str );

}
2)    Create a program that reads a text (.txt) file and does the following:
a.    Count the number of lines in the file
b.    Count the number of words in the file
The text file will be read from the command prompt:   
eg:  (for FileScan.java program)
c:\ java FileScan  myTextFile.txt

More products