Java   View all facts   Glossary   Help
specification > class > descendent > subclass
Updescendent

subclass
subjectfact 
subclass added by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
added by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
added by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
added by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
can access hidden member variables using the keyword superadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
can access overridden methods using the keyword superadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
can hide an inherited member variable by declaring a member variable with the same nameadded by: JT, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
can override an inherited method by defining a method with the same signatureadded by: JT, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
can use any member that is inheritedadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
cannot be defined until its direct superclass has been definedadded by: JK, source: On To Java, 2001-10-19 11:38:00.0
cannot override any class method (a method that is declared static in the superclass)added by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
cannot override any method that is declared final in the superclassadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
has definition A class that is an extension of another class, and hence inherits from the other classsource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:38:00.0
does not inherit constructoradded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
does not inherit the private members of its superclassadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
has example of creation
public class Movie extends Attraction
added by: JK, source: On To Java, 2001-10-19 11:38:00.0
inherits 0 or more methods from its superclass and all of its ancestorsadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
inherits 0 or more variables from its superclass and all of its ancestorsadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
inherits all instance variables and methods defined in its ancestor classes    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:38:00.0
inherits all package members of its ancestorsadded by: JT, 2001-10-19 11:38:00.0
inherits all protected members of its ancestorsadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:00.0
inherits all public members of its ancestorsadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:01.0
inherits none, some or all of its behaviour from all its ancestorsadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:01.0
inherits none, some or all of its state from all its ancestorsadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:01.0
is a subtopic of Classes2001-10-19 11:38:01.0
is created using the extends keyword    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:38:01.0
is a kind of descendentadded by: JK, source: Sun Java Tutorial, modified by: WH, 2001-10-19 11:38:01.0
classadds 0 or more variables to the variables it inherits from its superclass2001-10-19 11:36:19.0
adds 0 or more methods to the methods it inherits from its superclass2001-10-19 11:36:19.0
can be imported from a package2001-10-19 11:36:20.0
can extend only one superclass    2001-10-19 11:36:20.0
can have a main method2001-10-19 11:36:20.0
can have instances2001-10-19 11:36:20.0
can have more than one constructor each of which has different sets of arguments    2001-10-19 11:36:20.0
can have the same name as another class if the two classes are not in the same package and their packages are never imported into the same file    2001-10-19 11:36:20.0
can implement more than one interface    2001-10-19 11:36:20.0
can protect its members from access by other classes or objects using an access modifier2001-10-19 11:36:20.0
contains all of the code that relates to its objects including    2001-10-19 11:36:20.0
contains data associated with each object2001-10-19 11:36:20.0
declares a list of variables, called instance variables, corresponding to data that will be present in each instance    2001-10-19 11:36:20.0
has 2001-10-19 11:36:20.0
has 0 or more subclasses2001-10-19 11:36:20.0
has 1 superclass except Object class which has no superclass2001-10-19 11:36:20.0
has behaviour that is specified by its instance methods2001-10-19 11:36:20.0
has more specialized behaviour than a class farther up in the class hierarchy2001-10-19 11:36:20.0
has public interface which contains its public instance variables and instance methods2001-10-19 11:36:20.0
has benefit 2001-10-19 11:36:20.0
has example
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
2001-10-19 11:36:20.0
has part class name2001-10-19 11:36:20.0
has part code2001-10-19 11:36:20.0
has part constructor    2001-10-19 11:36:20.0
has syntax
class classname
{ // declarations of variables
// declarations of constructors
// declarations of other methods with public ones first
}   
2001-10-19 11:36:20.0
is abstract if it has one or more abstract methods2001-10-19 11:36:21.0
is the unit of data abstraction in an object-oriented program    2001-10-19 11:36:21.0
is a descendant of Object class2001-10-19 11:36:21.0
is specified by 1 class definition2001-10-19 11:36:21.0
may have access modifier 2001-10-19 11:36:21.0
provides implementation for all its instance methods unless the class is abstract2001-10-19 11:36:21.0
represents several similar objects2001-10-19 11:36:21.0
should be a member of 1 named package rather than the default package2001-10-19 11:36:21.0
should be named after a thing its instances represent in the real world2001-10-19 11:36:21.0
should be placed in its own source file    2001-10-19 11:36:21.0
should have a comment at the top describing the purpose of the class, how it should be used, its authors and its history of modification2001-10-19 11:36:21.0
should have a unique name since somebody in the future might want to import the packages containing both classes and hence create a name clash    2001-10-19 11:36:21.0
should not be named after the internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information'    2001-10-19 11:36:21.0
should order elements as follows:
  1. class variables
  2. instance variables
  3. constructors
  4. the most important public methods
  5. methods that are simply used to access variables
  6. private methods
2001-10-19 11:36:21.0
to instantiate you create an instance of it2001-10-19 11:36:21.0
access unithas access mode2001-10-19 11:35:59.0
syntactic unithas syntax rule
bold = mandatory
italic = non-terminal
normal font = optional
2001-10-19 11:38:04.0

Updescendent