GATE-Programming Methodology Questions and Answers

Practice Mode
Showing 10 of 105 questions
Q41
Static data members
  • A should be initialized like global variables.
  • B has only one copy of it exists for all instances of a class
  • C should be initialized like extern variables.
  • D both (a) and (b)
Answer: Option D
Q42
Which of the following statements are true. I. Constructors can be virtual. II. Destructors can't be virtual
  • A Both the are true.
  • B Both are false
  • C I is true and II is false
  • D II is true and I is false
Answer: Option B
Q43
Choose the correct statement I. Non-const object can't call constant member II. Constant objects can't call non-const member function III. A constant object can change non constant member function. IV. A constant object can't change non-constant member function. of these statement
  • A Both I and IV
  • B Both II and III
  • C All are correct
  • D All are wrong
Answer: Option D
Q44
Dynamic destruction is
  • A destruction of created objects.
  • B the deallocation of memory when the object goes out of scope
  • C simply memory deallocation.
  • D run-time memory deallocation.
Answer: Option B
Q45
Nested class is
  • A A class declared inside another class declared
  • B a derived class
  • C Abstract class
  • D None of these
Answer: Option A
Q46
Static class member's definitions and intializations occurs
  • A inside the class
  • B inside the objects of the class
  • C outside the class and function bodies
  • D anywhere
Answer: Option C
Q47
function overloading done at
  • A Run-time
  • B Compile-time
  • C Linnking time
  • D None of these
Answer: Option B
Q48
Protected members are accessible to
  • A members of its own class only
  • B to the members of deprived class
  • C Both (a) and (b)
  • D are not accessible outside the class.
Answer: Option C
Q49
A derived class
  • A inherits data members and member functions from base class.
  • B inheris constructors and destructors.
  • C object can access protected members with the dot operator.
  • D both (a) and (b)
Answer: Option A
Q50
The data type created by the data abstraction process is called
  • A class
  • B structure
  • C Abstract data type
  • D User-defined data type
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test