GATE-Programming Methodology Questions and Answers

Practice Mode
Showing 10 of 105 questions
Q1
Which of the following are good reasons to use an object oriented language ?
  • A you can define you own data types
  • B an object oriented program can be taught to correct its own erros
  • C It is easier to conceptualize an object
  • D both (a) and (c)
Answer: Option D
Q2
When a language has the capability to produce new data types, it is called
  • A extensible
  • B overloaded
  • C encapsulated
  • D reprehensible
Answer: Option A
Q3
Dividing a program into functions
  • A is the key object oriented programming
  • B Makes the program easier to conceptualize
  • C makes the program run faster
  • D both (b) and (c)
Answer: Option D
Q4
A variable defined within a block is visible
  • A throughut the functions
  • B from the point of definition onward in the block
  • C from the point of definitional onward in the functionq
  • D from the point of definition onward in the program
Answer: Option B
Q5
In object orient programming classes are useful because they
  • A can closely model objects in the real word
  • B bring together all aspects of an entity in one place
  • C permit data to be hidden from other cloasses
  • D all of these
Answer: Option D
Q6
Operator overloading is
  • A making C++ opertors work with objects
  • B giving, new meaning to existing C++ operators
  • C making new C++ operators
  • D both (a) and (b)
Answer: Option D
Q7
Assume a class C with obj1,obj2, and obj3. For the statement ofj3=1 - obj2 to work correctly, the overloaded operator must
  • A return a value
  • B create a named temporary object
  • C use the object of which it is a member as an operand
  • D both (a) and (c)
Answer: Option D
Q8
Inheritance is a way to
  • A pass arguments and improve data hiding
  • B pass arguments and add features to existing classes without rewriting them
  • C make general classes into more specific classes and add features to existing classes without rewriting them
  • D improve data hiding and encapsulation
Answer: Option C
Q9
In object oriented programming, advantages of inheritance incldude
  • A providing a useful conceptual framework
  • B avoiding rewriting of code
  • C facilitating class libraries
  • D all of these
Answer: Option D
Q10
Redirection redirects
  • A a file from a device to a stream
  • B a stream from a file to the screen
  • C a device from the screen to a file
  • D the screen from a device to a stream
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test