Quiz: Match the Methods
To which class do the methods belong? Your choices are:
a) Picture
b) String
c) Day
birthDay.getMonth() |
Day |
birthDay is an object of the Day class (assuming that it is the variable that we used in prior examples). |
"hello world!".length() |
String |
"hello world!" is an object of the String class. |
anniversary.addDays(365) |
Day |
You have seen addDays in the Mariner 4 quiz—another method of the Day class. |
lolcatsPic.draw() |
Picture |
We used the draw method in Lesson 1 to draw Picture objects. |