Publication | Closed Access
The JavaTM Language Environment
183
Citations
4
References
1998
Year
Unknown Venue
Powerful ConstructLanguage DocumentationEngineeringProgram AnalysisJavatm Language EnvironmentSoftware Language EngineeringProgramming Language ImplementationSoftware EngineeringAbstract SuperclassRectangle ClassSystem SoftwareLanguage StudiesSoftware AnalysisLinguisticsSoftware DesignProgramming Language Design
methods are a powerful construct in the object-oriented paradigm. To understand abstract methods, we look at the notion of an abstract superclass. An abstract superclass is a class in which you declare methods that aren’t actually implemented by that class—they only provide place-holders that subsequent subclasses must override and supply their actual implementation. This all sounds wonderfully, well, abstract, so why would you need an abstract superclass? Let’s look at a concrete example, no pun intended. Let’s suppose you’re going to a restaurant for dinner, and you decide that tonight you want to eat fish. Well, fish is somewhat abstract—you generally wouldn’t just order fish; the waiter is highly likely to ask you what specific kind of fish you want. When you actually get to the restaurant, you will find out what kind of fish they have, and order a specific fish, say, sturgeon, or salmon, or opakapaka. In the world of objects, an abstract class is like generic fish—the abstract class defines generic state and generic behavior, but you’ll never see a real live implementation of an abstract class. What you will see is a concrete subclass of the abstract class, just as opakapaka is a specific (concrete) kind of fish. Suppose you are creating a drawing application. The initial cut of your application can draw rectangles, lines, circles, polygons, and so on. Furthermore, you have a series of operations you can perform on the shapes—move, reshape, rotate, fill color, and so on. You could make each of these graphic shapes a separate class—you’d have a Rectangle class, a Line
| Year | Citations | |
|---|---|---|
Page 1
Page 1