Java OOP GUIDE / WORK NAME CLASS Topics
TASK –
PART 1 – NAME CLASS Create
a Name class based on the following class diagram:
Click
here for a brief explanation on
this class diagram. Notice
that once you create a Name object, you can no longer change any of its
instance variables. So this class is
said to be immutable. Note:
To get the first character of the String s, we use s.substring(0,1).
You will need to use this in the getInitials() method. |
|||
TASK – PART 2 – TESTING
THE NAME CLASS Create
another class called NameTester and follow the following steps:
|