AP计算机教程9-13:简单多选题
0:00
What best describes the purpose of a class’s constructor?
Under which of these conditions is it appropriate to overload a method (ie: the class will contain two methods with the same name)?
Which of the following statements about a class that contains an abstract method is (are) true?
I. You can’t have any constructors in this class.
II. This class must be declared as abstract.
III. You can’t declare any fields in this class.
abstract
method需要在abstract class
中。Which of the following is true about abstract classes?
abstract class
可以被继承,无法创建object。A car dealership needs a program to store information about the cars for sale. For each car, they want to keep track of the following information: number of doors (2 or 4), whether the car has air conditioning, and its average number of miles per gallon. Which of the following is the best design?
numDoors
、hasAir
与milesPerGallon
等信息适用包含关系,可作为Car
的field。A program is being written by a team of programmers. One programmer is implementing a class called Employee
; another programmer is writing code that will use the Employee
class. Which of the following aspects of the public methods and fields of the Employee
class does not need to be known by both programmers?
A bookstore is working on an on-line ordering system. For each type of published material (books, movies, audio tapes) they need to track the id, title, author(s), date published, and price. Which of the following would be the best design?
PublishedMaterial
作为parent class,Books
和Movies
作为child class,Title
、Price
、ID
、Authors
、DatePublished
等作为field是最好的设计。
0 条评论