click below
click below
Normal Size Small Size show me how
CS2Ch8ClassesObjects
Java Chapter 8 - Classes and Object-Oriented Development -Computer Science 2 G/T
| Question | Answer |
|---|---|
| Accessor Method | A method of a class that is used to determine the value of a variable member. Accessor methods have access level "public". |
| Behavior | The action and communication an object provides. |
| Class | A data type that defines variables for the state of an object and methods for an object’s behavior. |
| Class body | The variables, constructors, and methods that implement a class. |
| ClassCastException | An exception thrown when an object variable is cast with an incompatible class. |
| Class declaration | The first line of a class, which contains the access level, the keyword "class", and the class name. |
| Class method | A method of a class that can be called from the class itself. It cannot change the state of an object. Class methods include the keyword "static". |
| Class variable | A variable of a class that exists as one copy that all instances of a class refer to. Class variables include the keyword "static". |
| Client Code | An application that uses one or more classes. |
| Constructor | The part of a class that is used to initialize the variable members of a class |
| Encapsulation | Protecting an object's data from code outside the class. (a.k.a. Information Hiding) |
| Has-a relationship | The relationship demonstrated by a class that contains another class. |
| Helper method | A method of a class that is used by other methods in a class to help complete a task. Helper methods have access level "private". |
| Information Hiding | Protecting an object's data from code outside the class. (a.k.a. Encapsulation) |
| Inherit | To receive the methods of a superclass. |
| Instance | Any object of a class. |
| Instance method | A method of a class that changes the state of a class. It must be called from an instance of the class. |
| Instance variable | A variable of a class that is copied for each instance of the class. |
| Member | A variable or method of a class. |
| Message | Information passed from one object to another. |
| Modifier method | A method of a class that is used to change the value of a variable member. Modifier methods have access level public. |
| Modular | An application that uses components that are separately written and maintained. |
| Object | An instance of a class. An object stores data and can perform actions and provide communication. |
| Object casting | To cast an object as the appropriate class. |
| Object-Oriented Development | The solution to a task that is implemented as a system of objects. |
| Override | To redefine a method from a superclass in a subclass. |
| Reusability | A feature of object-oriented programming that reduces development time and decreases the likelihood of bugs. |
| State | The data that an object stores. |
| Subcalss | A class below another class in a class hierarchy. A class that inherits another class. |
| Superclass | The upper-most class in a class hierarchy. A class that has subclasses. |
| Visibility | The access level of a method. |
| "class" | The keyword used to declare a class. |
| "public" | An access modifier used in the declaration of a class to indicate that the class is visible to client code. Also used in the declaration of class methods to indicate that the method is visible to client code. |
| "static" | The keyword used in the declaration of a variable or method in a class to indicate that the member is a class method. |
| "private" | A keyword used in the declaration of class members when those members should be visible to the class but not to client code. |