Quiz
Review today's material by taking this three-question quiz.
Questions
1: | What operator is used to call an object's constructor method and create a new object?
|
2: | What kind of methods apply to all objects of a class rather than an individual object?
|
3: | If you have a program with objects named obj1
and obj2
, what happens when you use the statement obj2 = obj1
?
|
Answers
A1: | b. |
A2: | c. |
A3: | a. The = operator does not copy values from one object to another. Instead, it makes both variables refer to the same objectc |
Get Sams Teach Yourself Java 2 in 21 Days, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.