Lecture 4 - Classes Flashcards

1
Q

Class Definition

A

Software Module that contains attributes and operations. Basically, it contains data and the operations that could be performed on these data.

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

Equals method signature

A

public boolean equals(Object other) {

}

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

Static Methods

A

Static methods do not work on objects. This implies there is no reference to “this” and it has no access to it’s attributes (It can access static attributes).

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

Static Method call through Object

A

Will work but compiler will give a warning (NOT AN ERROR)

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

Static Attributes

A

It is common to all objects of a class (Each object of that class shares this attribute and does not get it’s own copy of this attribute).

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

Encapsulation

A

Used to hide implementation and as a safety measure against the programmer.

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