Java Reference
In-Depth Information
15 . Show an example of an overloaded varargs method that is ambiguous.
Here is one example of an overloaded varargs method that is ambiguous:
If you try to call myMeth( ) with one argument, like this,
the compiler can't determine which version of the method to invoke.
Chapter 7: Inheritance
1 . Does a superclass have access to the members of a subclass? Does a subclass have ac-
cess to the members of a superclass?
No, a superclass has no knowledge of its subclasses. Yes, a subclass has access to all
nonprivate members of its superclass.
2 . Create a subclass of TwoDShape called Circle . Include an area( ) method that com-
putes the area of the circle and a constructor that uses super to initialize the
TwoDShape portion.
Search WWH ::




Custom Search