| | |
| 1.1 | (d) A method is an operation defining the behavior for a particular abstraction. Java implements abstractions, using classes that have properties and behavior. Behavior is dictated by the operations of the abstraction. |
| | |
| 1.2 | (b) An object is an instance of a class. Objects are created from class definitions that implement abstractions. The objects that are created are concrete realizations of those abstractions. |
| | |
| 1.3 | (b) The code marked with (2) is a constructor. A constructor in Java is declared like a method, except that the name is identical to the class name and it does not specify a return value. |
| | |
| 1.4 | (b) and (f) Two objects and three reference variables are created by the code. Objects are typically created by using the new operator. Declaration of a reference variable creates a variable regardless of whether a reference value is assigned to it or not. |
| | |
| 1.5 | (d) An instance member is a field or an instance method. These members belong to an instance of the class rather than the class as a whole. Members which are not explicitly declared static in a class definition are instance members. |
| | |
| 1.6 | (c) An object can pass a message to another object by calling an instance method of the other object. |
| | |
| 1.7 | (d) and (f) Given the declaration class B extends A {...} we can conclude that class B extends class A , class A is the superclass of class B , class B is a subclass of class A , and class B inherits from class A , which means that objects of class B will inherit the field value1 from class A . |