anonymous inner class | | constructor | a 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 clash | 1 named package rather than the default package | static or not | any public class in other packages | inner class | Classes | 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 superclass | its own source file | | 0 or more methods to the methods it inherits from its superclass | private or protected | its 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 interface | elements as follows: - class variables
- instance variables
- constructors
- the most important public methods
- methods that are simply used to access variables
- private methods
| 1 class definition | behaviour from its superclass | implementation for all its instance methods unless the class is abstract | Object class | the internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information' | several similar objects | another class | create an instance of it | a list of variables, called instance variables, corresponding to data that will be present in each instance | data associated with each object | a package | private or protected |