TCS Technical Questions on Abstraction

1.What makes a class abstract?
a.By making all member functions constant.
b.By making at least one member function as pure virtual function.
c.By declaring it abstract using the static keyword.
d.By declaring it abstract using the virtual keyword.
Answer:b

2.Which type of class allows only one object of it to be created?
a.Virtual class
b.Abstract class
c.Singleton class
d.Friend class
Answer:c

3.Which of the following concepts of OOPS means exposing only necessary information to client?
a.Encapsulation
b.Abstraction
c.Data hiding
d.Data binding
Answer:d

4.Which type of inheritance needs a virtual function:
a.Multi level inheritance
b.Multiple inheritance
c.Hybrid inheritance
d.All of the above
Answer:d

5.Which of the following cannot be inherited?
a.Friend function
b.Static function
c.Destructor
Answer:b

6.Which of the following are available only in the class hierarchy chain?
a.Public data members
b.Private data members
c.Protected data members
d.Member functions
Answer:c

7.Which of the following is not a type of inheritance?
a.Multiple
b.Multilevel
c.Distributive
d.Hierarchical
Answer:c

8.The process of building new classes from existing one is called ______.
a.Polymorphism
B
b.Structure
c.Inheritance
d.Cascading
Answer:c

9.Which of the following supports the concept of hierarchical classification?
a.Polymorphism
b.Encapsulation
c.Abstraction
d.Inheritance
Answer:d

10.Which Keyword from the following is used to inherit properties from one class into another?
a.extends
b.subclasses
c.native
d.all of the mentioned
Answer:a