Object Oriented Java (Codecademy Cheatsheets) Flashcards

1
Q

Java objects’ state and behaviour

A

Instances of classes are called objects.

Object states are in the form of instance fields.

Object behavior is in the form of methods.

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

What is the dot notation in Java?

A

The dot is used to access variables and methods of an object or class.

Structure: instanceOrClassName.fieldOrMethodName

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

What is the constructor method in Java?

A

Java classes contain a contractor method which is used to create instances of the class.

If no constructor is defined, a default empty constructor is used.

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

What are reference data types?

A

A variable with a reference data type has a value that references the memory address of an instance. During variable declaration, the class name is used as the variable’s type

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

What are constructor signatures?

A

A class can have multiple constructors so long as they have different parameter values. A signature helps the compiler differentiate between the different constructors.

A signature is made of the constructor’s name and a list of its parameters.

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

What are nested conditional statements?

A

These are conditional statements placed inside other conditional statements. The outer one is evaluated first. Depending on the result, the inner conditional statement is either evaluated or not.

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

What is the NOT operator?

A

Represented by “!”, this operator negates the value of a boolean expression.

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

What is the AND logical operator?

A

Represented by “&&”, this operator returns true if the boolean expressions on both sides of the operator are true, otherwise it returns false.

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

What is the OR operator?

A

Represented by “||”, returns true if at least one of the boolean expressions being compared has a true value , otherwise it returns false.

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

What is the order of operations of conditional operators?

A

Expression in paranthesis—NOT—AND— OR.

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