Supertype and Subtype
This section describes the supertype-subtype relationships: a supertype corresponds a class or interface that is extended or implemented directly or indirectly by the class or interface of the subtype.
Based on Class and Interface hierarchical relationships, Java class and interface reference types are related to each other
with supertype-subtype relationships.
- Supertype - A class type or interface type is a supertype relative to another type, if its
corresponding class or interface has been extended or implemented directly or indirectly by the class or interface of the other type.
- Subtype - A class type or interface type is a subtype relative to another type, if its
corresponding class or interface is extending or implementing directly or indirectly the class or interface of the other type.
Using the class interface hierarchy example presented in the previous section, the supertype-subtype relationship
can be illustrated in the picture below:
Based on the picture, we can say:
- javax.net.ssl.X509ExtendedKeyManager is a subtype of java.lang.Object.
- javax.net.ssl.X509ExtendedKeyManager is a subtype of javax.net.ssl.X509KeyManager.
- javax.net.ssl.X509ExtendedKeyManager is a subtype of javax.net.ssl.KeyManager.
- javax.net.ssl.KeyManager is a supertype of javax.net.ssl.X509ExtendedKeyManager.
- javax.net.ssl.KeyManager is a supertype of javax.net.ssl.X509KeyManager.
- java.lang.Object is a supertype of all other class and interface types.
Last update: 2014.
Table of Contents
About This Book
JDK - Java Development Kit
Execution Process, Entry Point, Input and Output
Primitive Data Types and Literals
Bits, Bytes, Bitwise and Shift Operations
Managing Bit Strings in Byte Arrays
►Reference Data Types and Variables
Reference Types Supported in Java
Creating Class Type Objects
Class Type Variables Storing References
Interface Type Variables
Class and Interface Hierarchy
►Supertype and Subtype
Explicit and Implicit Type Casting
Type Casting Example Program
Type Casting Compile and Runtime Error
StringBuffer - The String Buffer Class
System Properties and Runtime Object Methods
Generic Classes and Parameterized Types
Generic Methods and Type Inference
Lambda Expressions and Method References
Java Modules - Java Package Aggregation
Execution Threads and Multi-Threading Java Programs
ThreadGroup Class and "system" ThreadGroup Tree
Synchronization Technique and Synchronized Code Blocks
Deadlock Condition Example Programs
Garbage Collection and the gc() Method
Full Version in PDF/EPUB