Placement Paper - Technical- OOPS - Grapecity

1.Is it possible for a member function of a class to activate another member function of the same class?

  1. no

  2. yes,but only public member functions.

  3. Yes, only private member functions

  4. Yes, both public & private member functions can be activated

2. Can 2 classes contain member functions with the same name?

  1. no

  2. yes, but only if the 2 classes have the same name

  3. yes, but only if the main program does not declare both kinds

  4. yes, this is always allowed

3.what is the purpose of template functions?

  1. to allow a single function to be used with varying types of arguments

  2. to hide the same name of the function from the linker

  3. to implement container classe

  4. to permit the use of the debugger without the –gstabs flag

 

4.what kind of functions can access private member variables of a class

 

a. friend function of a class

b. private member functions of the class

c. public member functions of the class

  1. all of the above

  2. none

 

5. what technique is used to step thro’ items of a container class?

  1. copy constructor

  2. default constructor

  3. iterator (ans)

 

6. what is the term used to describe the situation when a derived class provides a function already provided in the base class ?

  1. inheritning

  2. overriding

  3. abstraction

  4. none

 

7. what r the characteristics of object, in general

  1. it has name, properties

  2. name, properties, behaviour

  3. it can act on receiving a message

  4. a &c

  5. b&c

 

8. bundling data members together with the functions is called

  1. data hiding

  2. encapsulation (ans)

  3. data morphism

  4. data binding

 

9.why is OO programming useful?

  1. It supports good s/w engg. Practices

  2. It promotes thinking abt s/w in a way that models the way we think & interact naturally

  3. Supports code reuse

  4. A &b

  5. A,b & c

 

10. suppose tu want 2 develop 2 diff, + operators that calculate & return an object of the same class. Which stmt is correct?

  1. 1 operator must be a frnd & the other must not

  2. 1 operator must be public & the other private

  3. operators must have different parameter lists

  4. it is not possible 2 have 2 different + operators

 

11.what is inheritance?

  1. a relationship in which the structure & functionality of a class (“child ) is defined in terms of the structure & functionality of another(parent)

  2. a relationship in which the structure & functionality of a class (“parent” ) is defined in terms of the structure & functionality of another(“child”)

  3. a relationship in which the structure & functionality of a class make calls 2 functionalty of another

  4. a relationship in which the structure of a class includes 1 or more instances of another

  5. all of above

 

12. what is relationship betn . a class & its public parent class

  1. “.is a….”

  2. “has a”

  3. “is implemented as a ……”

  4. uses a

  5. becomes a

 

13. how does inheritance relate 2 abstraction?

A . a base class is an abstraction of all its derived classes

b. a derived class is an abstraction of all its base classes

  1. Base & derived classes are abstractions for each other

  2. Inheritance prevents abstration

  3. No relationship betn them

14. why can’t compiler “hard-code” direct calls to virtual functions?

  1. b’coz hard –coding the fn. Call wud slow compilation of the program too much

  2. b’coz hard –coding the fn. Call wud slow execution of the program too much

  3. b’coz the correct fn. To call generally isn’t know at compile –time

  4. b’coz virtual fns are always at compile-time so no run-time code is needed at all.

  5. Compiler does hard-code direct calls 2 virtual functions.

15. what is accessibility of a protected member of a base class which is inherited privately?

a. private: b’coz the private inheritance makes everything frm the base class private in the derived class (ans)

Disclaimer: These are questions/Answers posted by various candidates over years, TutionCentral(TC) does not assume any legal liability or responsibility for the accuracy, completeness or usefulness of the information. Information provided in the site is solely intended for general guidance purpose and assumes the reader of the page full responsibility of use.


SHARE THIS
Previous Post
Next Post