Java OOP GUIDE / WORK RECTANGLE CLASS 3 Topics
TASK –
PART 1 – SETUP Copy
the follow class into your IDE (Eclipse).
TASK –
PART 2 – SHORT QUESTIONS a)
How many instance variables does this class have? b)
How many constructors does this class have? c)
How many instance methods does this class have? d)
Why do two of the statements in the constructor
have a “this” and two do not? |
|
TASK –
PART 3 – DATA ENCAPSULATION Use data encapsulation on the class. Make all instance variables private. Include get and set methods for all instance
variables.
|