Home > Java > Abstract Classes > Definitions
Definitions

Top 10 Abstract Classes Definitions

1

An abstract class, or abstract base class (ABC), is a class that cannot be instantiated. Such a class is only meaningful if the language supports inheritance. An abstract class is designed only as a parent class from which child classes may be derived. Abstract classes are often used to represent abstract concepts or entities. The incomplete features of the abstract class are then shared by a group of subclasses which add different variations of the missing pieces.

Abstract classes are superclasses which contain abstract methods and are defined such that concrete subclasses are to extend them by implementing the methods. The behaviors defined by such a class are "generic" and much of the class will be undefined and unimplemented. Before a class derived from an abstract class can become concrete, i.e. a class that can be instantiated, it must implement particular methods for all the abstract methods of its parent classes.

When specifying an abstract class, the programmer is referring to a class which has elements that are meant to be implemented by inheritance. The abstraction of the class methods to be implemented by the subclasses is meant to simplify software development. This also enables the programmer to focus on planning and design.

Author:
Wikipedia
Source:
Type:
Website

Rating: 0.0/5 (0 votes cast)

Favorite
2

There are situations in which you will want to define a superclass that declares the structure of a given abstraction without providing a complete implementation of every method. That is, sometimes you will want to create a superclass that only defines a generalized form that will be shared by all of its subclasses, leaving it to each subclass to fill in the details. Such a class determines the nature of the methods that the subclasses must implement. One way this situation can occur is when a superclass is unable to create a meaningful implementation for a method.

Author:
Kamini
Source:
Type:
Website

Rating: 0.0/5 (0 votes cast)

Favorite
3

An abstract class is a class that is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. An abstract method is a method that is declared without an implementation (without braces, and followed by a semicolon).

If a class includes abstract methods, the class itself must be declared abstract.When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class. However, if it does not, the subclass must also be declared abstract.

Author:
java.sun.com
Source:
Type:
Website

Rating: 0.0/5 (0 votes cast)

Favorite
4

Abstract methods are usually declared where two or more subclasses are expected to fulfil a similar role in different ways. Often the subclasses are required to the fulfil an interface, so the abstract superclass might provide several of the interface methods, but leave the subclasses to implement their own variations of the abstract methods. Abstract classes can be thought of as part-complete templates that make it easier to write a series of subclasses.

Author:
codestyle.org
Source:
Type:
Website

Rating: 0.0/5 (0 votes cast)

Favorite
5

An abstract class is a class that is declared by using the abstract keyword. It may or may not have abstract methods. Abstract classes cannot be instantiated, but they can be extended into sub-classes.

Author:
.roseindia.net
Source:
Type:
Website

Rating: 0.0/5 (0 votes cast)

Favorite
6

In constructing a hierarchy of relationships among various classes, it is sometimes beneficial to include a class, normally at the top of the hierarchy, whose methods cannot be instantiated. The class acts as a blueprint for all subclasses, and as such it can be extended to suit different classes within the taxonomy.

An abstract method is defined by the method’s signature and has no method body. An abstract class is a class that contains at least one abstract method. As a result, an abstract class cannot be instantiated since there would be no means of implementing the abstract method(s) within the class.When a class contains at least one abstract method, the class is automatically taken to be abstract. However, not all the methods of an abstract class need be abstract. There can be a mixture of constructors, implemented methods, and method signatures.

A subclass of an abstract class may be instantiated, provided that the abstract methods of the abstract class are overridden and implemented in the subclass. If all the abstract methods are not implemented, the subclass must also be abstract.

Author:
Barry J. Holmes and Daniel T. Joyce
Source:
Type:
Book

Rating: 0.0/5 (0 votes cast)

Favorite
7

In a class hierarchy, the higher the class, the more abstract its definition. A class at the top of a hierarchy of other classes can define only the behavior and attributes common to all the classes. More specific behavior and attributes are going to fall somewhere lower down the hierarchy.

When you are factoring out common behavior and attributes during the process of defining a hierarchy of classes, you might at times find yourself with a class that doesn’t ever need to be instantiated directly. Instead, such a class serves as a place to hold common behavior and attributes shared by their subclasses.

These classes are called abstract classes, and they are created using the abstract modifier.

Author:
Rogers Cadenhead and Laura Lemay
Source:
Type:
Book

Rating: 0.0/5 (0 votes cast)

Favorite
8

When we think of a class type, we assume that programs will create objects of that type. In some cases, however, it is useful to declare classes for which the programmer never intends to instantiate objects. Such classes are called abstract classes. Because they are used only as superclasses in inheritance hierarchies, we refer to them as abstract superclasses. These classes cannot be used to instantiate objects, because abstract classes are incomplete.

An abstract class’s purpose is to provide an appropriate superclass from which other classes can inherit and thus share a common design. Abstract superclasses are too general to create real objects—they specify only what is common among subclasses.

Author:
Deitel - Deitel
Source:
Type:
Book

Rating: 0.0/5 (0 votes cast)

Favorite
9

There are situations in which you will want to define a superclass that declares the structure of a given abstraction without providing a complete implementation of every method. That is, sometimes you will want to create a superclass that only defines a
generalized form that will be shared by all of its subclasses, leaving it to each subclass to fill in the details. Such a class determines the nature of the methods that the subclasses must implement. One way this situation can occur is when a superclass is unable to create a meaningful implementation for a method.

To accomplish this task we use abstract classes. An abstract class is an interface, template or blueprint for its subclasses. Subclasses must provide services which are specified by abstract class using its abstract methods. An abstract class can have abstract methods (without implementations) and simple methods (with implementation). Pure abstract class contains only abstract methods. Abstract class cannot be initiated.

Author:
Patrick Naughton and Herbert Schildt
Source:
Type:
Book

Rating: 0.0/5 (0 votes cast)

Favorite