Jump to content
Wikibooks The Free Textbook Project

Java Programming/Keywords/extends

From Wikibooks, open books for an open world

This is the current revision of this page, as edited by Strange quark (discuss | contribs) at 18:27, 4 July 2017 (Fix categorization). The present address (URL) is a permanent link to this version.

Revision as of 18:27, 4 July 2017 by Strange quark (discuss | contribs) (Fix categorization)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

extends is a Java keyword.

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

Syntax:

Computer code
publicclass MyClassextendsSuperClass
{
//...
}

publicinterface MyInterfaceextendsSuperInterface
{
//...
}


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

Computer code
class Foo<TextendsNumber>{/*...*/}


See also:

AltStyle によって変換されたページ (->オリジナル) /