What is an abstract class what is an abstract


1. If a class contains an abstract method, the class must be declared _____.

abstract

public

private

None of the above

Question 2. What is an abstract class?

A generalized class used only to create related subclasses

A class without any superclasses

A class from which we create many instances

Any subclass with more than one superclass

Question 3. What is an abstract method?

Any method in an abstract class

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

A method which cannot be inherited

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

Question 4. Which of the following classes is most likely an abstract class?

Vehicle

BlueSpruce

HandSaw

Goldfish

Question 5. In terms of object-oriented programming, a _____ is a mechanism that forces a programmer to adhere to specific rules when developing an application.

contract

base class

requirements analysis

method signature

None of the above

Question 6. An abstract method can be declared in which of the following?

Abstract classes

Any base class

Concrete classes

A and B

A and C

B and C

Question 7. Which language allows implementation of multiple inheritance using only base classes?

Java

C#

C++

All of the above

Question 8. Which of the following class definitions defines a legal abstract class?

class abstract Dog {

void Eat();

}

public abstract class Dog {

void Eat (){}

}

abstract private class Dog {

void Eat ();

}

public class abstract Dog {

void Eat (){}

}

Question 9. Which of the following declares an abstract method in an abstract C# class?

public abstract Calc();

public abstract void Calc();

public void Calc() {}

public void abstract Calc();

Question 10. Which of the following statements is true?

Interfaces contain a list of methods to be implemented.

Interfaces are classes with one or more unimplemented methods.

Interfaces can be instantiated just like regular classes.

Besides the naming convention, there is no difference between an interface and a class.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: What is an abstract class what is an abstract
Reference No:- TGS01085041

Expected delivery within 24 Hours