Home           J2EE Concepts           JMS           Java Language           Contact           Back           Next           Bookmark this Page          










Some useful tips related to:
 - health & fitness
 - vehicle care
 - cooking
 - misc household tasks

Implementing Interfaces


If a class wants to implement an interface, it must include the implements keyword in class definition, and then create the methods defined by the interface.

Note that an interface may be implemented by any no. of classes. This is the way in which Java supports multiple inheritence. For implementing multiple interfaces, the interface names must be separated by a comma. Following pseudo code shows the structure of a class implementing two interfaces:
class myClass implements interface1, interface2 {
// ....
}

When a class implementes an interface method, it must be declared as public.