Which of the following pairs is an example of an is-a relationship?
Which Java statement is used to declare a class Triangle that is derived from class Shape?
a.public class Triangle implements Shape
b.public class Triangle extends Shape
c.public class Triangle is-a Shape
d.public class TriangleShape
A Java object can be a field in another Java object.
Which method is automatically called when a Java object is instantiated?
Assume that you have created a class named Dog that contains a data field namedweight and an instance method named setWeight(). Further assume that the setWeight() method is public and accepts a numeric parameter named pounds. Which of the following statements correctly sets a Dog‘s weight within the setWeight() method?
a.pounds = weight
b.weight = pounds
c.either of these
d.none of these