System.out.println("Implement meth3().");
}
}
class IFExtend {
public static void main(String arg[]) {
MyClass ob = new MyClass();
ob.meth1();
ob.meth2();
ob.meth3();
}
}
As an experiment, you might want to try removing the implementation for meth1( ) in
MyClass. This will cause a compile-time error. As stated earlier, any class that implements
an interface must implement all methods defined by that interface, including any that are
inherited from other interfaces.
Although the examples we've included in this topic do not make frequent use of packages
or interfaces, both of these tools are an important part of the Java programming environment.
Virtually all real programs that you write in Java will be contained within packages. A number will
probably implement interfaces as well. It is important, therefore, that you be comfortable with
their usage.
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home