Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Questions
- What methods would a class that implements the
java.lang.CharSequence
interface have to implement?
- What is wrong with the following interface?
public interface SomethingIsWrong { public void aMethod(int aValue){ System.out.println("Hi Mom"); } }
- Fix the interface in question 2.
- Is the following interface valid?
public interface Marker { }Exercises
- Write a class that implements the
CharSequence
interface found in thejava.lang
package. Select one of the sentences from this book to use as the data. Write a smallmain
method to test your class; make sure to call all four methods.
- Suppose you have written a time server that periodically notifies its clients of the current date and time. Write an interface the server could use to enforce a particular protocol on its clients.
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.