Java Terms Flashcards

Memorize the Basics

1
Q

What are the Characteristics of an Object?

A

State and Behavior

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Where does an Object expose its Behavior?

A

Methods or Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Where does an Object stores its State?

A

Fields or Variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is data encapsulation?

A

a. Hidden Internal state

b. Requires all interaction to be performed through an Object’s methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the benefits of Objects?

A

a. Modularity
b. Information-hiding
c. Code re-use
d. Pluggability and debugging ease

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a class?

A

The blueprint from which individual Objects are created

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Inheritance?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an Interface?

A

Group of related methods with empty bodies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What forms an Object’s Interface with the outside world?

A

Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do Objects define their interaction with the outside world?

A

Exposed Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a package?

A

a. Namespace that organizes a set of related classes and interfaces
b. Similar to folders on a PC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the 4 kinds of Variables in Java

A
  1. Instance - Non static values unique to each instance of a class
  2. Class - Only one copy of this variables exists
  3. Local - Only visible to methods where they are declared
  4. Parameter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is an array?

A

A container that holds a fixed number of values of a single type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is each item in an array called?

A

An element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How is an element in an array accessed

A

By its numerical index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the 7 conventions in naming a variable?

A
  1. Case Sensitive
  2. Start with a letter
  3. Full words
  4. Must not be a keyword or reserved word
  5. If only one word then all letters lower case
  6. If more than one word the first word is all lower case and subsequent words start with upper case (ex.upperCase)
  7. If variable stores a constant value then all words are in upper case separated by an underscore
    (ex. BEST_WESTERN)