CMSC 132 Lecture Notes - Lecture 9: Cloning, Control Flow

88 views3 pages

Document Summary

No food or drinks are allowed in the ta room. Please do not rearrange the furniture. Please be considerate of fellow students who need help. once you have spoken with your ta please clear out to allow other students the same opportunity. When overriding a method in java, you can define the return type to be a subtype of the. We can create a copy of an object using the clone() method. The object class provides a clone() method that provides shallow copying. Clonenotsupportedexception - thrown to indicate that the clone method in class object. Notice the object class clone() method is defined as protected. All interactions with objects occur through reference variables. If no reference to object exists, object becomes garbage (useless, no longer affects program) Only needed if running low on memory. Contains action performed when object is freed. Not invoked if garbage collection does not occur. Share code between multiple constructors for same class.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents