Inheritance:
Inheritance
suggest changeIntroduction
Inheritance is a basic object oriented feature in which one class acquires and extends upon the properties of another class, using the keyword extends. For Interfaces and the keyword implements, see interfaces.
Syntax
- class ClassB extends ClassA {…}
- class ClassB implements InterfaceA {…}
- interface InterfaceB extends InterfaceA {…}
- class ClassB extends ClassA implements InterfaceC, InterfaceD {…}
- abstract class AbstractClassB extends ClassA {…}
- abstract class AbstractClassB extends AbstractClassA {…}
- abstract class AbstractClassB extends ClassA implements InterfaceC, InterfaceD {…}
Remarks
Inheritance is often combined with generics so that the base class has one or more type parameters. See Creating a Generic Class.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents
0Inheritance
10Maps
11Strings
25JAXB
28Optional
29Enums
32Audio
41Scanner
63Logging
75Lists
78Sets
89JAX-WS
96XJC
98Process
106Modules
110ClasssLoader
114Applets
116New File I/O
122JNDI
126Atomic types
135NumberFormat
138Unit Testing
139JavaBean
140Expressions
141Literals
144Packages
150JMX
153JShell
154Benchmarks
159Sockets
160Java Sockets
163List vs. set
1642D graphics
165Reflection
167Enum Map
175Hashtable
177SortedMap
178WeakHashMap
180StringBuffer
184Contributors