Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.(TCO 7) If a class contains an abstract method, the class must be declared____

ID: 3660301 • Letter: 1

Question

1.(TCO 7) If a class contains an abstract method, the class must be declared_____. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>

a. abstract

b. public

c. private

d. None of the above

2.(TCO 7) An abstract _____ is used only to form related subclasses using inheritance since it cannot be instantiate.

a. method

b. class

c. object

d. attribute

3.(TCO 7) What is an abstract method?

a. Any method in an abstract class

b. A method without a body that is declared with the reserved word abstract

c. A method which cannot be inherited

d. A method that takes an abstract object as a parameter and returns nothing

4.(TCO 7) Which of the following classes is most likely an abstract class?

a. BlackWidow

b. Dime

c. Aspirin

d. Tree

5.(TCO 7) When using ____, developers are required to comply with the rules defined in a framework.

a. inheritance

b. base classes

c. object-oriented constructs

d. contracts

e. None of the above

6.(TCO 7) An abstract method can be declared in which of the following?

a. Abstract classes

b. Any base class

c. Concrete classes

d. A and B

e. A and C

f. B and C

7.(TCO 7) C++ allows for the implantation of multiple inheritance whereas C# and Java do not. However, in languages such as C# and Java, _____ can be used to simulate multiple inheritance.

a. abstract methods

b. base classes

c. interfaces

d. implementation

8.(TCO 7) Which of the following class definitions defines a legal abstract class?

a. public abstract Automobile { void Drive(); }

b. public class abstract Automobile { void Drive(); }

c. public abstract class Automobile { void Drive(){} }

d. public class abstract Automobile { void Drive(){} }

9.(TCO 7) Which of the following declares an abstract method in an abstract C# class?

a. public abstract Print();

b. public void Print() {}

c. public abstract void print() {}

d. public abstract void print();

10.(TCO 7) Which of the following statements is false?

a. Interfaces can be written in individual files, just like classes.

b. The name of an interface in C#, often begins with an uppercase "I".

c. Interfaces can be used to implement a form of multiple inheritance.

d. Interfaces are instantiated just like any other class.

Explanation / Answer

D) None of the above A) Method A) Any method in abstract class B) Dime C) Object-oriented constructs A) Abstract classes D) Implementation B) Public class abstract Automobile { void Drive(); } D) Public abstract void print(); C) Interfaces can be used to implement a form of multiple inheritance.