Java Terms Flashcards
Memorize the Basics
What are the Characteristics of an Object?
State and Behavior
Where does an Object expose its Behavior?
Methods or Functions
Where does an Object stores its State?
Fields or Variables
What is data encapsulation?
a. Hidden Internal state
b. Requires all interaction to be performed through an Object’s methods
What are the benefits of Objects?
a. Modularity
b. Information-hiding
c. Code re-use
d. Pluggability and debugging ease
What is a class?
The blueprint from which individual Objects are created
What is Inheritance?
a. Common state and behavior used in a subclass from its superclass
b. A subclass may only have one superclass
c. A superclass may have unlimited subclasses
What is an Interface?
Group of related methods with empty bodies
What forms an Object’s Interface with the outside world?
Methods
How do Objects define their interaction with the outside world?
Exposed Methods
What is a package?
a. Namespace that organizes a set of related classes and interfaces
b. Similar to folders on a PC
What are the 4 kinds of Variables in Java
- Instance - Non static values unique to each instance of a class
- Class - Only one copy of this variables exists
- Local - Only visible to methods where they are declared
- Parameter
What is an array?
A container that holds a fixed number of values of a single type
What is each item in an array called?
An element
How is an element in an array accessed
By its numerical index