Abstract type
In programming languages, an abstract type (also known as existential types) is a type in a nominative type system that cannot be instantiated directly; by contrast, a concrete type be instantiated directly.[src] Instantiation of an abstract type can occur only indirectly, via a concrete subtype.[src] An abstract type may provide no implementation, or an incomplete implementation.[src] In some languages, abstract types with no implementation (rather than an incomplete implementation) are known as protocols, interfaces, signatures, or class types.[src] In class-based object-oriented programming, abstract types are implemented as abstract classes (also known as abstract base classes), and concrete types as concrete classes.[src] In generic programming, the analogous notion is a concept, which similarly specifies syntax and semantics, but does not require a subtype relationship: two unrelated types may satisfy the same concept.[src] Often, abstract types will have one or more implementations provided separately, for example, in the form of concrete subtypes that be instantiated.[src] In object-oriented programming, an abstract class may include abstract methods or abstract properties that are shared by its subclasses.[src] Other names for language features that are (or may be) used to implement abstract types include traits, mixins, flavors, roles, or type classes.…[src]
In programming languages, an abstract type (also known as existential types) is a type in a nominative type system that cannot be instantiated directly; by contrast, a concrete type be instantiated directly.[src] Instantiation of an abstract type can occur only indirectly, via a concrete subtype.[src] An abstract type may provide no implementation, or an incomplete implementation.[src] In some languages, abstract types with no implementation (rather than an incomplete implementation) are known as protocols, interfaces, signatures, or class types.[src] In class-based object-oriented programming, abstract types are implemented as abstract classes (also known as abstract base classes), and concrete types as concrete classes.[src] In generic programming, the analogous notion is a concept, which similarly specifies syntax and semantics, but does not require a subtype relationship: two unrelated types may satisfy the same concept.[src] Often, abstract types will have one or more implementations provided separately, for example, in the form of concrete subtypes that be instantiated.[src] In object-oriented programming, an abstract class may include abstract methods or abstract properties that are shared by its subclasses.[src] Other names for language features that are (or may be) used to implement abstract types include traits, mixins, flavors, roles, or type classes.[src] Abstract types may also include any number of non-abstract methods and properties, such as when implementing the Template Method Pattern which uses a mixture of invariant methods with fixed implementations and hook methods which can be overridden in concrete subclasses to provide custonised logic.[src] ==Examples== ===Java=== By default, all methods in all classes are concrete, unless the abstract keyword is used.[src] An abstract class may include abstract methods, which have no implementation.[src] By default, all methods in all interfaces are abstract, unless the default keyword is used.[src] The default keyword can be used to specify a concrete method in an interface.[src] // By default, all methods in all classes are concrete, unless the abstract keyword is used.[src] abstract class Demo { // An abstract class may include abstract methods, which have no implementation.[src] public abstract int sum(int x, int y); // An abstract class may also include concrete methods.[src] public int product(int x, int y) { return x * y; } } // By default, all methods in all interfaces are abstract, unless the default keyword is used.[src] interface DemoInterface { int getLength(); // The abstract keyword can be used here, though is completely useless // The default keyword can be used in this context to specify a concrete method in an interface default int product(int x, int y) { return x * y; } } ==Further reading== Core Java: An Integrated Approach by R.[src] Nageswara Rao[src]
29 sentences · 29 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Abstract type." encyclopegia.org, 2026, https://encyclopegia.org/wiki/abstract-type. Accessed 26 November 2026.
Chicago
"Abstract type." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/abstract-type.
APA
encyclopegia.org. (2026). Abstract type. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/abstract-type
Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON