Download presentation
Presentation is loading. Please wait.
Published byWilfrid Harrison Modified over 9 years ago
1
PARISUTHAM INSTITUTE OF TECHNOLOGY AND SCIENCE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS 6301 – PROGRAMMING AND DATA STRUCTURES II QUIZ – I
2
1. Who is father of C++ Language?
Dr. E.F. Codd James A. Gosling Bjarne Stroustrup Dennis Ritchie
3
2. _________ allows to create classes which are derived from other classes, so that they automatically include some of its "parent's" members, plus its own members. Overloading Inheritance Polymorphism Encapsulation
4
3. Important advantage of using new and delete operators in C++ is
Allocation of memory Frees the memory previously allocated Allocation of memory and frees the memory previously allocated Initialization of memory easily
5
4. Which of the following correctly describes overloading of functions?
Virtual polymorphism Transient polymorphism Ad-hoc polymorphism Pseudo polymorphism
6
5. Which of the following operators can not be overloaded in C+ +?
* == += ::
7
6. What is a size of empty class in c++?
4 bytes 2 bytes 0 bytes 1 bytes
8
7. In c++ object of the class is also called?
Constants Tag Instance Data collection
9
8. ________ is a default access specifier for members of class in C++.
protected public private default
10
9. In object oriented programming, by wrapping up characteristics and behavior into one unit, we achieve Data Abstraction Data Encapsulation Data Hiding All of these
11
10. The mechanism that binds code and data together and keeps them secure from outside world is known as Abstraction Encapsulation Inheritance Polymorphism
12
11. A Class can have how many destructor?
2 3 4
13
12. The parameter list in function overloading must differ by?
Number of functions Function Size Function Name Number of argument
14
13. Data members is also called?
Attribute Method Class Object
15
14. In how many ways is polymorphism achived in C++?
2 3 1 4
16
15. The Object is not declared for which class?
Parent Base Abstract Derived
17
16. The constructor without parameter is called?
Method Constructor Default Constructor Operator Constructor Function Constructor
18
17. The static member variable is initialized to?
1 2 -1
19
18. Which of the following is user defined data type?
Public Private Class A & B Both
20
19. A __________ is a special method used to initialize the instance variable of a class.
Member function Destructor Constructor Structure
21
20. Member of a class specified as _______ are accessible only to method of the class.
private public protected derive
22
21. The goal of operator overloading is __________.
To help the user of a class To help the developer of a class To help define friend function None of the above
23
22. What features make C++ so powerful?
Easy implementation Code reusability Easy memory management All the above
24
23. Local Variables can be access ?
Code block enclosed in braces { }. Code block enclosed in bracket (). Code block enclosed in square bracket []. None of the above
25
24. Global Variables can be access ?
Anywhere in the code except inside functions. After it's declaration. Anywhere in the code, even inside functions. After it's declaration. Nowhere in the code None of the above
26
25. In C++ every statement end with?
Colon (:) Comma (,) Dot (.) None of the above
27
26. What is pointer? The variable that stores the reference to another variable The variable that stores reference of garbage variable The variable that stores the memory address of another variable A & C Both
28
27. If class A inherits from more than one class, ie
27. If class A inherits from more than one class, ie. A inherits from B1, B2,... is called Single Inheritance Multilevel Inheritance Multiple Inheritance None of the above
29
28. If class A inherits from class B, then B is called _______ of A
28. If class A inherits from class B, then B is called _______ of A. A is called ________ of B. Super class, Sub class Subclass, Super class Abstract class, Base Class Child class, Sub Class
30
29. ________ is the mechanism which allows a class A to inherit properties of a class B. A. Data abstraction B. Encapsulation C. Inheritance D. Polymorphism
31
30. Which of the following statements is correct?
First time method of a class is called, the constructor method is called. Every time method of a class is called, the constructor method is called. Every time an instance of a class is created, the constructor method is called. None of the above
32
31. Ability to take many forms is called ________. A. inheritance B
31. Ability to take many forms is called ________. A. inheritance B. polymorphism C. encapsulation D. member function
33
32. The run time system performs __________ on virtual functions.
Static binding additional error checking C. dynamic binding D. no special services
34
33. A _____________ pointer can point to ____________ object.
derived class, base class void, derived class void, NULL base class, derived class
35
34. A virtual function is a member function that expects to be _________ in a derived class. A. private B. none of these C. overridden D. called frequently
36
35. For proper display of polymorphism, a method in the base class must be declared _______. A. private B. public C. protected D. virtual
37
36. The major goal of inheritance in C++ is
To facilitate the conversion of data types To help modular programming C. To facilitate the re usability of code D. To extend the capabilities of a class
38
37. The process of giving special meaning to an operator is A
37. The process of giving special meaning to an operator is A. Operator overloading B. Operator mechanism C. Operator definition D. None of the above
39
38. The binding of a function call at runtime is A. Static binding. B
38. The binding of a function call at runtime is A. Static binding B. Early binding C. Late binding D. Runtime binding
40
39. With in ………….scope class member may be referenced simply by their names A. class’s B. object’s C. program D. none of the above
41
40. A class that acts only as a base class and is not used to create objects is
parent class super class abstract class none of the above
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.