Java   View all facts   Glossary   Help
member > inner class
Next memberinstance member    Upmember, nested class    Previous memberclass member   

inner class comparison table
Subject have part define have syntax have be a member of be access is a kind of is a subtopic of have example implement have syntax rule override place in have benefit add have access modifier protect have access mode use order specify by inherit provide be a descendant of name after represent extend instantiate you declare contain import from have access level
anonymous inner classconstructora constructor
class classname
{ // declarations of variables
// declarations of constructors
// declarations of other methods with public ones first
}
a unique name since somebody in the future might want to import the packages containing both classes and hence create a name clash1 named package rather than the default packagestatic or notany public class in other packagesinner classClasses
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
a single interface
bold = mandatory
italic = non-terminal
normal font = optional
methods that are inherited from the class's superclassits own source file0 or more methods to the methods it inherits from its superclassprivate or protectedits members from access by other classes or objects using an access modifier an implements clause to declare that it contains methods for each of the operations specified by the interfaceelements 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
1 class definitionbehaviour from its superclassimplementation for all its instance methods unless the class is abstractObject classthe internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information'several similar objectsanother classcreate an instance of ita list of variables, called instance variables, corresponding to data that will be present in each instancedata associated with each objecta packageprivate or protected

Next memberinstance member    Upmember, nested class    Previous memberclass member