1. The process of creating new classes from the existing classes is
(a) Polymorphism (b) Encapsulation (c) Inheritance (d) Data Abstraction
2. Inheritance is a process of creating new classes
(a) Base classes (b) Parent classes (c) Super classes (d) Derived classes
3. The existing class is called as
(a) Sub class (b) Abstract class (c) Derived class (d) Base class
4. The default visibility mode is
(a) static (b) protected (c) private (d) public
5. A derived class inherits from multiple base classes is known as
(a) Multiple inheritance (b) Hybrid inheritance (c) Multilevel inheritance (d) Single inheritance
6. When a derived class inherits only from one base class is known as
(a) Multipath inheritance (b) Multiple inheritance (c) Multilevel inheritance (d) Single inheritance
7. The class from which the new classes are derived is known as
(a) Base (b) Child (c) Derived (d) Sub
8. Which of the following class is a power packed class with additional attributes and methods?
(a) Derived (b) Static (c) Abstract (d) Base
9. Which of the following class inherits all the properties of the base class?
(a) Abstract (b) Super (c) Base (d) Derived
10. Which keyword is used to define a derived class?
(a) base (b) class (c) derived (d) sub
11. Access specifier is also referred to as
(a) Accessibility (b) Visibility mode (c) Acceptability or Accessibility (d) Acceptability
12. The symbol that must be used between derived and base class is
(a) : (b) :: (c) & (d) #
13. Which are not inherited but are executed first when an instance of the derived class is created?
(a) Data Members (b) Member functions (c) Destructors (d) Constructors
14 Which form of inheritance is reflected by the transitive nature of inheritance?
(a) Multilevel (b) Multiple (c) Hierarchical (d) Single
15. Classes used only for deriving other classes are called as
(a) Super classes (b) Abstract classes (c) Static classes (d) Concrete classes
16. Read the following declarations:
class vehicle
{
int wheels ;
public:
void inputdata(int, int);
void outputdata( );
protected:
int passenger;
};
class heavy_vehicle:protected vehicle
{
int diesel _petrol;
protected:
int load;
public:
void readdata(i nt, int);
void write data() ;
};
class bus:private heavy_vehicle
{
char marks[20];
publ ic:
void fetchdata(char) ;
void displaydata( );
};
Which is the base class of the heavy_vehicle?
(a) vehicle (b) both bus and vehicle (c) heavy_Vehicle (d) bus
17. The data member that can be accessed from the function displaydata() is
(a) load (b) passenger (c) marks (d) all these three choices
18. The member function can be accessed by an object of bus class is ___ ___ ___ ___ .
(a) None of other three choices (b) inputdata, outputdata
(c) readdata, writedata (d) fetchdata, displaydata
19. The most powerful feature of an object oriented programming language is
(a) Encapsulation (b) Class (c) Polymorphism (d) Inheritance
20. Which of the following is a class from which other classes are de rived?
(a) Derived class (b) Base class (c) Function class (d) Super class
21. How the derived class should be indicated?
(a) Class der_name, visibility mode, base class_id
(b) Class der_name :: visibility mode base class_id
(c) Class der_name : visibility mode base class_id
(d) Class der_name ; visibility mode base class_id
22. Read the following declarations:
class A
int x,y;
protected:
int s,t;
public:
int u, v;
};
class B:public A
{
};
The data members that inherit from Class A to Class B
(a) u, v (b) x, y (c) Both s,t and u, v (d) s, t
23. u, v data members contain which visibility mode in Class B?
(a) Public (b) Private (c) Either Private or Protected (d) Protected
24. s,t data members contain which visibility mode in Class B?
(a) Static (b) Protected (c) Private (d) Public
25. What must be used between derived and visibility modes?
(a) ; (b) :: (c) : (d) !
26. For which class, objects cannot be declared?
(a) Abstract (b) Destructor (c) Void (d) Constructor