Programming Abstractions in Java 1st Edition Roberts Solutions Manual download
Programming Abstractions in Java 1st Edition Roberts Solutions Manual download
https://testbankfan.com/product/programming-abstractions-in-
java-1st-edition-roberts-solutions-manual/
https://testbankfan.com/product/data-structures-and-abstractions-with-
java-5th-edition-carrano-solutions-manual/
https://testbankfan.com/product/data-structures-and-abstractions-with-
java-4th-edition-carrano-solutions-manual/
https://testbankfan.com/product/java-programming-9th-edition-farrell-
solutions-manual/
https://testbankfan.com/product/college-algebra-graphs-and-models-5th-
edition-bittinger-solutions-manual/
HIST 3rd Edition Schultz Test Bank
https://testbankfan.com/product/hist-3rd-edition-schultz-test-bank/
https://testbankfan.com/product/microeconomic-theory-basic-principles-
and-extensions-10th-edition-nicholson-test-bank/
https://testbankfan.com/product/principles-of-microeconomics-2nd-
edition-mateer-test-bank/
https://testbankfan.com/product/questions-and-answers-a-guide-to-
fitness-and-wellness-3rd-edition-liguori-test-bank/
https://testbankfan.com/product/family-in-transition-17th-edition-
skolnick-test-bank/
Mathematics for Elementary Teachers 5th Edition Beckmann
Test Bank
https://testbankfan.com/product/mathematics-for-elementary-
teachers-5th-edition-beckmann-test-bank/
Answers to review questions from Chapter 8
1. In Java, what header line would you use to define a class named Sub that inherited the public behavior
from a class named Super?
public class Sub extends Super
2. True or false: The superclass specification in a new class definition may not be a parameterized class
with specific instantiation of the types.
False.
3. True or false: A new definition of a method in a Java subclass automatically overrides the definition of
that method in its superclass.
True.
4. What is an abstract class? Is it possible for an abstract class to provide its own implementation of its
exported methods?
An abstract class is a class definition that cannot be instantiated on its own but only by creating
one of its subclasses. The abstract class can provide implementations of exported methods,
which can then be used for any subclass.
5. What two levels of access control does Java offer beyond public and private?
Protected access is available to subclasses of the class and any classes in the same package.
Package-private classes (which do not specify any of public, private, or protected) are
available only to classes in the same package.
6. A constructor for a subclass always calls a constructor for its superclass. How do you specify that you
would like to call some constructor that is not the default constructor?
In many cases, it is better to embed an existing object inside a new class and then use forwarding
to implement the desired operations.
8. What are the three concrete GObject subclasses implemented in this chapter?
GRect, GOval, and GLine.
9. Which of these subclasses respond to the method setFilled? Which respond to the method
setColor? In which classes are these two methods defined?
The GRect and GOval classes respond to setFilled, which is defined in both of these classes.
The setColor method is defined in the GObject class and is therefore available in all three
subclasses.
10. In what ways does Java’s coordinate system differ from the traditional Cartesian coordinate system?
The Java coordinate system has its origin in the upper left corner instead of the lower left corner
traditionally used in the Cartesian plane.
12. What is the purpose of the synchronized statement in the implementation of the GWindow class?
Java’s synchronized statement is to ensure that two threads do not try to update some data
value simultaneously. In the GWindow implementation, the thread that runs the application is
independent of the thread that repaints the components on the screen. Without the
synchronized statement, it is possible that the application will try to add a GObject to the
contents list while the repainting thread is going through its elements.
testbankfan.com