{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Classes In Java (8) - COP 3330 Object-Oriented Programming...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3330: Classes In Java Part 3 Page 1 © Dr. Mark Llewellyn COP 3330: Object-Oriented Programming Summer 2011 Classes In Java Part 3 Abstract Classes and Interfaces Department of Electrical Engineering and Computer Science Computer Science Division University of Central Florida Instructor : Dr. Mark Llewellyn [email protected] HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cop3330/sum2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
COP 3330: Classes In Java Part 3 Page 2 © Dr. Mark Llewellyn Abstract Classes In the inheritance hierarchy, classes become more specific and concrete with each new subclass. If you move from a subclass back up to a superclass, the classes become more general and less specific. Class design should ensure that a superclass contains common features of its subclasses. Sometimes a superclass is so abstract that it cannot have any specific instances. Such a class is called an abstract class .
Background image of page 2
COP 3330: Classes In Java Part 3 Page 3 © Dr. Mark Llewellyn Abstract Classes Recall our GeometricObject class that was the superclass for Circle and Rectangle . The GeometricObject class models common features of geometric objects. Both the Circle and Rectangle classes contain the getArea() and getPerimeter() methods for computing the area and perimeter of a circle and a rectangle.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon