Which of the following class definitions defines a legal abstract class?

a. class A { abstract void unfinished() { } }
b. class A { abstract void unfinished(); }
c. abstract class A { abstract void unfinished(); }
d. public class abstract A { abstract void unfinished(); }


c In A and B, abstract keyword is missing for the class. In D, class and abstract are in a wrong order. The correct answer is C.

Computer Science & Information Technology

You might also like to view...

Which is the advantage of encapsulation?

a. Only public methods are needed. b. Making the class final causes no consequential changes to other code. c. It changes the implementation without changing a class's contract and causes no consequential changes to other code. d. It changes a class's contract without changing the implementation and causes no consequential changes to other code.

Computer Science & Information Technology

Write a program that reads records of type Pet from a file created by the program described in the previous programming project and displays the following information on the screen: the name and weight of the heaviest pet, the name and weight of the lightest pet, the name and age of the youngest pet, and the name and age of the oldest pet.

This project requires only one file and has a structure similar to Project 6 (in fact it has the same code for getInputFile() and closeFile() methods.

Computer Science & Information Technology

Load the records of Exercise 17.31 into expandable hash files based on extendible hashing. Show the structure of the directory at each step. Show the directory at each step, and the global and local depths. Use the hash function h(k) = K mod 128.

What will be an ideal response?

Computer Science & Information Technology

Use Figures 3.14 and 3.15 to identify a characteristic shared by the petal width and petal length attributes.

What will be an ideal response?

Computer Science & Information Technology