Lecture 4 - Classes Flashcards
Class Definition
Software Module that contains attributes and operations. Basically, it contains data and the operations that could be performed on these data.
Equals method signature
public boolean equals(Object other) {
}
Static Methods
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).
Static Method call through Object
Will work but compiler will give a warning (NOT AN ERROR)
Static Attributes
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).
Encapsulation
Used to hide implementation and as a safety measure against the programmer.