Java   View all facts   Glossary   Help
member
Next kbTopmember of a package    UpkbTop    Previous kbTopmechanism   

member comparison table
Subject have syntax rule destroy in add declare protect is a subtopic of name after access declare by create refer to access by extend has part provide place in represent inherit return to contain use by have purpose is a synonym of have access level pass as have example instantiate you implement import from have scope be part of belong to order is a kind of initialize by be a descendant of define specify by have access modifier be accessible to hide declare anywhere in use override have syntax have benefit be a member of have have part return has definition be is partitioned into
class member     Members               every method of the class static member          member                A member of a class which is either a field or a method class method, class variable
inner class
bold = mandatory
italic = non-terminal
normal font = optional
 0 or more methods to the methods it inherits from its superclassa list of variables, called instance variables, corresponding to data that will be present in each instanceits members from access by other classes or objects using an access modifierClassesthe internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information'any public class in other packages    only one superclass implementation for all its instance methods unless the class is abstractits own source fileseveral similar objectsbehaviour from its superclass data associated with each object   private or protected 
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
create an instance of itmore than one interfacea package   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
nested class Object classa class type whose instances are the values of the class type1 class definitionprivate or protected   an implements clause to declare that it contains methods for each of the operations specified by the interfacemethods that are inherited from the class's superclass
class classname
{ // declarations of variables
// declarations of constructors
// declarations of other methods with public ones first
}
1 named package rather than the default packagea unique name since somebody in the future might want to import the packages containing both classes and hence create a name clashconstructor A nested class whose instance exists within an instance of its enclosing class and has direct access to the instance members of its enclosing instancestatic or not 
instance member     Members                            member                  instance method, instance variable
member variable
bold = mandatory
italic = non-terminal
normal font = optional
the block where it is declared      giving the data type followed by the name of the variable a class or an object or a primitive datumother variables and methods in any class in the same package by default  value     only values that are of the same type as the variable or a subtype of the variable's type to refer to an object or a class or a primitive datumfield          variablean assignment statement   the code in its class a class outside of a method    a class or an objectcomment if it is non-obvious   as private as possibleclass variable, instance variable
method
bold = mandatory
italic = non-terminal
normal font = optional
    Methods all instance variables of all objects of its class an object by instantiating a class other methods and variables in any class in the same package by default a block of implementation code    its caller from only one place which should be the last statementreturn statement unless it has a void return type  member function an argument to a method or constructor    a class or an objecta class specification  its return type  instance variables, class variables from other objects the super method to invoke a method declared in the superclassa method in a superclass with the same name   a comment at its head if the method is non-obviousmethod signaturea value that is of the return type of the method or a subtype of that typeCode that specifies some of the behaviour of a class or instancepublic except for those that will definitely need to be called from outside the packagestatic method, instance method

Next kbTopmember of a package    UpkbTop    Previous kbTopmechanism