CPSC 233 Lecture Notes - Lecture 9: Object Copying, Unified Modeling Language

19 views2 pages

Document Summary

Eg: public class point extens object implements cloneable { public object clone() throws clonenotsupportedexception { return super. clone(); Point a,b; a = new point (3. 0,5. 0); try { By default, clone() does a shallow copy: i. e a bitwise copy from one chunk of memory to another. //won"t compile: expected the concrete subclasses will extend the abstract class. An abstract method has no code: consists of a method signature only, prepended with the keyword abstract. Eg: public abstract class shape { public abstract double area(): expected that an overriding method in a concrete subclass will supply an implementaion. A class that has one or more abstract methods is automaically abstract: you must use the abstract keyword for the class. Are denoted using italics: e. g. (uml diagram) Since italics are diicult to hand write, an alternate form uses the <> stereotype. An interface is a collecion of : unimplemented declaraions of methods, and/or, class constants.

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