41
QUIZ PRELIMS QUESTION

QUIZ PRELIMS QUESTION

  • Upload
    scott

  • View
    44

  • Download
    0

Embed Size (px)

DESCRIPTION

QUIZ PRELIMS QUESTION. 1) Which of the following statements is correct? A)First time method of a class is called, the constructor method is called. B)Every time method of a class is called, the constructor method is called. - PowerPoint PPT Presentation

Citation preview

Page 1: QUIZ PRELIMS QUESTION

QUIZ PRELIMS QUESTION

Page 2: QUIZ PRELIMS QUESTION

1) Which of the following statements is correct?

A)First time method of a class is called, the constructor method is called.

B)Every time method of a class is called, the constructor method is called.

C)Every time an instance of a class is created, the constructor method is called.

D)None of the above

Page 3: QUIZ PRELIMS QUESTION

ANSWER: C)Every time an instance of a class is

created, the constructor method is called.

Page 4: QUIZ PRELIMS QUESTION

2)________ is the mechanism which allows a class A to inherit properties of a class B.

A)Data abstractionB)EncapsulationC)InheritanceD)Polymorphism

Page 5: QUIZ PRELIMS QUESTION

ANSWER:

C)Inheritance

Page 6: QUIZ PRELIMS QUESTION

3) If class A inherits from class B, then B is called _______ of A. A is called ________ of B.

A)Super class, Sub classB)Subclass, Super classC)Abstract class, Base ClassD)Child class, Sub Class

Page 7: QUIZ PRELIMS QUESTION

ANSWER:

A)Super class, Sub class

Page 8: QUIZ PRELIMS QUESTION

4) If class A inherits from more than one class, ie. A inherits from B1, B2,... is called

A)Single InheritanceB)Multilevel InheritanceC)Multiple InheritanceD)None of the above

Page 9: QUIZ PRELIMS QUESTION

ANSWER:

C)Multiple Inheritance

Page 10: QUIZ PRELIMS QUESTION

5) What is pointer?

A)The variable that stores the reference to another variable

B)The variable that stores reference of garbage variableC)The variable that stores the memory address of another

variableD) A & C Both

Page 11: QUIZ PRELIMS QUESTION

ANSWER:

D) A & C Both

Page 12: QUIZ PRELIMS QUESTION

6) In C++ every statement end with?

A)Colon (:)B)Comma (,)C)Dot (.)D)None of the above

Page 13: QUIZ PRELIMS QUESTION

ANSWER:

D)None of the above

Page 14: QUIZ PRELIMS QUESTION

7) Global Variables can be access ?

A)Anywhere in the code except inside functions. After it's declaration.

B)Anywhere in the code, even inside functions. After it's declaration.

C)Nowhere in the codeD)None of the above

Page 15: QUIZ PRELIMS QUESTION

ANSWER:

B)Anywhere in the code, even inside functions. After it's declaration.

Page 16: QUIZ PRELIMS QUESTION

8) Local Variables can be access ?

A)Code block enclosed in braces { }.B)Code block enclosed in bracket ().C)Code block enclosed in square bracket [].D)None of the above

Page 17: QUIZ PRELIMS QUESTION

ANSWER:

A)Code block enclosed in braces { }.

Page 18: QUIZ PRELIMS QUESTION

9) What features make C++ so powerful?

A)Easy implementationB)Code reusabilityC)Easy memory managementD)All the above

Page 19: QUIZ PRELIMS QUESTION

ANSWER:

D)All the above

Page 20: QUIZ PRELIMS QUESTION

10) The goal of operator overloading is __________.

A)To help the user of a classB)To help the developer of a classC)To help define friend functionD)None of the above

Page 21: QUIZ PRELIMS QUESTION

ANSWER:

A)To help the user of a class

Page 22: QUIZ PRELIMS QUESTION

11) Member of a class specified as _______ are accessible only to method of the class.

A)privateB)publicC)protectedD)derive

Page 23: QUIZ PRELIMS QUESTION

ANSWER:

A)private

Page 24: QUIZ PRELIMS QUESTION

12) A __________ is a special method used to initialize the instance variable of a class.

A)Member functionB)DestructorC)ConstructorD)Structure

Page 25: QUIZ PRELIMS QUESTION

ANSWER:

C) Constructor

Page 26: QUIZ PRELIMS QUESTION

13) Which of the following is user defined data type?

A)PublicB)PrivateC)ClassD)A & B Both

Page 27: QUIZ PRELIMS QUESTION

ANSWER:

C)Class

Page 28: QUIZ PRELIMS QUESTION

14) The static member variable is initialized to?

A)0B)1C)2D)-1

Page 29: QUIZ PRELIMS QUESTION

ANSWER:

A)0

Page 30: QUIZ PRELIMS QUESTION

15) The constructor without parameter is called?

A)Method ConstructorB)Default ConstructorC)Operator ConstructorD)Function Constructor

Page 31: QUIZ PRELIMS QUESTION

ANSWER:

B)Default Constructor

Page 32: QUIZ PRELIMS QUESTION

16) The Object is not declared for which class?

A)ParentB)BaseC)AbstractD)Derived

Page 33: QUIZ PRELIMS QUESTION

ANSWER:

C)Abstract

Page 34: QUIZ PRELIMS QUESTION

17) Data members is also called?

A)AttributeB)MethodC)ClassD)Object

Page 35: QUIZ PRELIMS QUESTION

ANSWER:

A)Attribute

Page 36: QUIZ PRELIMS QUESTION

18) The parameter list in function overloading must differ by?

A)Number of functionsB)Function SizeC)Function NameD)Number of argument

Page 37: QUIZ PRELIMS QUESTION

ANSWER:

D)Number of argument

Page 38: QUIZ PRELIMS QUESTION

19) A Class can have how many destructor?

A)1B)2C)3D)4

Page 39: QUIZ PRELIMS QUESTION

ANSWER:

A)1

Page 40: QUIZ PRELIMS QUESTION

20) The mechanism that binds code and data together and keeps them secure from outside world is known as

A)AbstractionB)EncapsulationC)InheritanceD)Polymorphism

Page 41: QUIZ PRELIMS QUESTION

ANSWER:

B)Encapsulation