Java   View all facts   Glossary   Help
specification > class
Next access unitconstructor    Upaccess unit, specification    Previous access unitvariable   

class
subjectfact 
class added by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:19.0
added by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:19.0
added by: DS, source: Sun Java Tutorial, modified by: WH, 2001-10-19 11:36:19.0
added by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:19.0
added by JK -source: Java in a Nutshell, 2001-10-19 11:36:19.0
adds 0 or more variables to the variables it inherits from its superclassadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:19.0
adds 0 or more methods to the methods it inherits from its superclassadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:19.0
can access any public class in other packagesadded by: DS, 2001-10-19 11:36:20.0
can be imported from a packageadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
can extend only one superclass    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
can have a main methodadded by: Marvin, 2001-10-19 11:36:20.0
can have instancessource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
can have more than one constructor each of which has different sets of arguments    source: Object Oriented Software Engineering by Lethbridge and Laganière, 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    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
can implement more than one interface    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
can override methods that are inherited from the class's superclassadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
can protect its members from access by other classes or objects using an access modifieradded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
cannot inherit method implementations from an interfacesource: Sun Java Tutorial, 2001-10-19 11:36:20.0
contains all of the code that relates to its objects including    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
contains data associated with each objectsource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
declares a list of variables, called instance variables, corresponding to data that will be present in each instance    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
defines added by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
defines a class type whose instances are the values of the class typeadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
has definition A software module that provides both procedural and data abstraction. It describes a set of similar objects, called its instances    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
has definition A blueprint (prototype) that defines (the variables and the methods) common to all objects of a certain kindadded by: JK, source: Sun Java Tutorial, reference: Tutorial, 2001-10-19 11:36:20.0
has definition A specification that defines variables and methods common to a set of all objects of a certain kindadded by: DS, reference: Source 2, 2001-10-19 11:36:20.0
has definition A template that describes the data and behaviour of its instances called objectsadded by: DS, reference: Source 2, 2001-10-19 11:36:20.0
has added by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
has 0 or more subclassesadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
has 1 superclass except Object class which has no superclassadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
has behaviour that is specified by its instance methodsadded by: JT, 2001-10-19 11:36:20.0
has more specialized behaviour than a class farther up in the class hierarchyadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
has public interface which contains its public instance variables and instance methodsadded by: JK, source: On To Java, 2001-10-19 11:36:20.0
has benefit added by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
has example
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
added by: JK, 2001-10-19 11:36:20.0
has part class namesource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
has part codesource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
has part constructor    source: Object Oriented Software Engineering by Lethbridge and Laganière, 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
}   
source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:20.0
inherits 0 or more methods from its superclassadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
inherits 0 or more variables from its superclassadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:20.0
inherits behaviour from its superclassadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:21.0
is abstract if it has one or more abstract methodssource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:21.0
is the unit of data abstraction in an object-oriented program    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:21.0
is a descendant of Object classadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:21.0
is a subtopic of Classes2001-10-19 11:36:21.0
is partitioned into abstract class, concrete classadded by: WH, 2001-10-19 11:36:21.0
is specified by 1 class definitionadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:21.0
is a kind of access unitadded by: DS, 2001-10-19 11:36:21.0
is a kind of specificationadded by: DS, 2001-10-19 11:36:21.0
may have access modifier added by: JK, source: Teach Yourself Java 2 in 21 Days, 2001-10-19 11:36:21.0
provides implementation for all its instance methods unless the class is abstractadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:21.0
represents several similar objectssource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:21.0
should be a member of 1 named package rather than the default packageadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:36:21.0
should be named after a thing its instances represent in the real worldsource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:21.0
should be placed in its own source file    source: Object Oriented Software Engineering by Lethbridge and Laganière, 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 modificationsource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-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    source: Object Oriented Software Engineering by Lethbridge and Laganière, 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'    source: Object Oriented Software Engineering by Lethbridge and Laganière, 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
source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:21.0
to instantiate you create an instance of itadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:21.0
uses an implements clause to declare that it contains methods for each of the operations specified by the interface    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-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

Kinds of class :

Next access unitconstructor    Upaccess unit, specification    Previous access unitvariable