![]() |
specification > class > abstract class |
![]() ![]() | ||||
abstract class | ||||
subject | fact |
abstract class | can define 1 programming interface | ![]() |
can have concrete methods or instance variables ![]() | ![]() | |
can omit some or all of the implementation of its methods ![]() | ![]() | |
can provide 0 or more method declarations for all methods needed to implement its programming interface to its subclasses | ![]() | |
cannot be final | ![]() | |
cannot have instances | ![]() | |
defines generic behaviour | ![]() | |
has definition A class that can only be subclassed - it cannot be instantiated or the compiler will display an error message and refuse to compile the program ![]() | ![]() | |
has purpose to hold features that will be inherited by two or more subclasses ![]() | ![]() | |
is the opposite of concrete class | ![]() | |
is a subtopic of Classes | ![]() | |
is created by specifying the abstract keyword on the first line when you declare the class ![]() | ![]() | |
is not required to have any abstract methods ![]() | ![]() | |
is a kind of class | ![]() | |
usually is not fully defined | ![]() | |
class |
| ![]() |
![]() | ||
| ![]() | |
![]() | ||
![]() | ||
adds 0 or more variables to the variables it inherits from its superclass | ![]() | |
adds 0 or more methods to the methods it inherits from its superclass | ![]() | |
can access any public class in other packages | ![]() | |
can be imported from a package | ![]() | |
can extend only one superclass ![]() | ![]() | |
can implement more than one interface ![]() | ![]() | |
can override methods that are inherited from the class's superclass | ![]() | |
can protect its members from access by other classes or objects using an access modifier | ![]() | |
cannot inherit method implementations from an interface | ![]() | |
contains all of the code that relates to its objects including
![]() | ![]() | |
contains data associated with each object | ![]() | |
declares a list of variables, called instance variables, corresponding to data that will be present in each instance ![]() | ![]() | |
has benefit
| ![]() | |
has example public class HelloWorld { | ![]() | |
has part class name | ![]() | |
has part code | ![]() | |
has part constructor ![]() | ![]() | |
has syntax class classname | ![]() | |
inherits 0 or more methods from its superclass | ![]() | |
inherits 0 or more variables from its superclass | ![]() | |
inherits behaviour from its superclass | ![]() | |
is a descendant of Object class | ![]() | |
is specified by 1 class definition | ![]() | |
may have access modifier | ![]() | |
represents several similar objects | ![]() | |
should be a member of 1 named package rather than the default package | ![]() | |
should be named after a thing its instances represent in the real world | ![]() | |
should be placed in its own source file ![]() | ![]() | |
should not be named after the internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information' ![]() | ![]() | |
should order elements as follows: | ![]() | |
to instantiate you create an instance of it | ![]() | |
uses an implements clause to declare that it contains methods for each of the operations specified by the interface ![]() | ![]() | |
access unit | has access mode | ![]() |
syntactic unit | has syntax rule bold = mandatory | ![]() |
Kinds of abstract class :
Next class: ancestor Up: class Previous class: wrapper class