GATE-Programming Methodology Questions and Answers

Practice Mode
Showing 10 of 105 questions
Q11
The public files in a class library usually contain
  • A variable definition, constant definition
  • B class declaration, variable definition
  • C member function definition
  • D constant definition, class declaration
Answer: Option A
Q12
Breaking a program into several files is desirable because
  • A some files don't need to be recompiled each time
  • B a program can be divided functionally
  • C files can be marked in object form
  • D all of these
Answer: Option C
Q13
Choose one most appropriate of the following.
  • A the reference variables are bound to memory location at compile time only.
  • B Reference variable bound to memoy location at link time only
  • C Reference variable bound to memory location at load time only.
  • D None of these
Answer: Option A
Q14
Runtime polymorphism can be achieved by
  • A accessing virtual function through the pointer of base class
  • B by accessing virtual function through the object
  • C both (a) and (b)
  • D none of these
Answer: Option A
Q15
Which one of the following is true statement ?
  • A Friend function can access public data only
  • B Scope of friend function is limited within the class where it is declared
  • C A friend function can't be called using the object of that class
  • D Like class member, it can acess the class members directly.
Answer: Option D
Q16
This pointer for any class internally declared as
  • A int*this;
  • B X*this
  • C const X*this
  • D X*const this;
Answer: Option D
Q17
In a single class function polymorphism happens on
  • A Run time
  • B Compile time
  • C Both (a) and (b)
  • D None of these
Answer: Option D
Q18
In a single class virtual polymorphism happen on
  • A Run time
  • B Compile time
  • C Both (a) and (b)
  • D None of these
Answer: Option A
Q19
The use of constructor is
  • A to initilize the objects of its class
  • B to allocate memory for the objects of its class
  • C both (a) and (b)
  • D none of these
Answer: Option A
Q20
Which one of the following is correct
  • A Constructors return values
  • B Constructors cont be overloaded.
  • C Destructors do not have return values
  • D There can be any number of constructors and destructors.
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test