GATE-Programming Methodology Questions and Answers

Practice Mode
Showing 10 of 105 questions
Q31
Which one of the following is pure virtual function?
  • A Virtual void funct (int n)
  • B virtual void funct () = 0
  • C virtual funct (int n);
  • D virtual void funct (int n) = 0
Answer: Option D
Q32
Virtual pointer is
  • A data member
  • B pointer to a base class
  • C pointer to a derived class
  • D none of these
Answer: Option A
Q33
Data members and member function of a class by default is respectively
  • A private and public
  • B public and private
  • C both private
  • D both public
Answer: Option A
Q34
Method overloading is
  • A Overloading different member function of a class.
  • B A feature in which multiple functions with same name and different signature
  • C overloading without argument passing
  • D none of these
Answer: Option A
Q35
In the binary overloaded operator function, second operand should be passed
  • A explicitly
  • B implicitly
  • C passed by value
  • D passed by reference
Answer: Option A
Q36
Overloading without explicit arguments to an operator function called
  • A Binary operator overloading
  • B Unary operator overloading
  • C the class allowing access to another class
  • D none of these
Answer: Option B
Q37
Friend function should be declared in the ..... part of the class.
  • A public
  • B private
  • C both (a) and (b)
  • D Anywhere
Answer: Option C
Q38
A friend function can be called
  • A by using object of the class
  • B directly
  • C should not be called
  • D like a normal function
Answer: Option D
Q39
A const member functions
  • A doesn't change data fields of the object
  • B can't be overloaded
  • C don't have regurn type
  • D have no arguments
Answer: Option A
Q40
Static member functions
  • A can access only static members in the same class
  • B has only one copy of it exists for all instances of a class
  • C can access constant members
  • D both (b) and (c)
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test