class | bold = mandatory italic = non-terminal normal font = optional | 0 or more methods to the methods it inherits from its superclass | | a list of variables, called instance variables, corresponding to data that will be present in each instance | its members from access by other classes or objects using an access modifier | Classes | the 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 abstract | its own source file | several similar objects | behaviour from its superclass | data associated with each object | public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } | create an instance of it | more than one interface | a package | elements as follows: - class variables
- instance variables
- constructors
- the most important public methods
- methods that are simply used to access variables
- private methods
| specification | Object class | a class type whose instances are the values of the class type | 1 class definition | | | | an implements clause to declare that it contains methods for each of the operations specified by the interface | methods 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 package | a unique name since somebody in the future might want to import the packages containing both classes and hence create a name clash | constructor | A template that describes the data and behaviour of its instances called objects | the unit of data abstraction in an object-oriented program | abstract class, concrete class |
FileInputStream | bold = mandatory italic = non-terminal normal font = optional | 0 or more methods to the methods it inherits from its superclass | stream | a list of variables, called instance variables, corresponding to data that will be present in each instance | its members from access by other classes or objects using an access modifier | Input and Output | the 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 abstract | its own source file | several similar objects | behaviour from its superclass | data associated with each object | public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } | create an instance of it | more than one interface | a package | elements as follows: - class variables
- instance variables
- constructors
- the most important public methods
- methods that are simply used to access variables
- private methods
| | Object class | a class type whose instances are the values of the class type | 1 class definition | | reading 1 byte at a time | FileInputStream stream = new FileInputStrem(inputFileNameOrPath); | to read bytes from a file | methods 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 package | specification | constructor | | the unit of data abstraction in an object-oriented program | |