< Java Programming < Keywords

extends is a Java keyword.

Used in class and interface definition to declare the class or interface that is to be extended.

Syntax:

public class MyClass extends SuperClass 
{
  //...
}
 
public interface MyInterface extends SuperInterface
{
  //...
}

In Java 1.5 and later, the "extends" keyword is also used to specify an upper bound on a type parameter in Generics.

class Foo<T extends Number> { /*...*/ }

See also:

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.