Basic OOPS Question -

A unit of computer information that contains data as well as all the procedures or operations is called:
(1) A method.
(2) Encapsulation.
(3) An object.
(4) An OOP
(5) None of these

This question is a bit confusing to me.. what do you guys think? 🙄

  • 11
    It seems pretty obvious to me is 3 I might be wrong tho, I'm an ape
  • 7
    Ans : Object !?
    Since method , encapsulation is not a unit
    OOP is a paradigm
  • 3
    I see what's confusing about it. For me it's at least a bit weird to say an object contains all the procedures or operations, because the methods in memory are just referenced, not replicated for every class instance.
  • 0
    @Nawap yeah me too thinking in the same way.. @rgomez yeah..

    @lucaspar exactly this is what I was thinking..
  • 4
    Object contains methods, how it contains, is thru memory reference!

    Since, as far I learnt, I heard object contains data and function!
  • 0
    What else it can be ?
  • 6
    My first thought was it's an class. As it actually holds data, it's an instantiation of a class, which yields an object. Thus IMO (3) should be the correct answer.
    You could also answer (5) and say it's (a region of) memory, wouldn't be wrong if you'd ask me.
  • 1
    3) an object, instance of a class, a specific instance of a class in memory.
    While it can hold some static data defined during class creation it can also load it dynamically from other sources, otherwise it would be pretty useless.
  • 5
    It’s definitely 3. That’s the definition of an object. It means conceptually contains, not physically contains (i.e. in memory).
  • 3
    3 beyond doubt. Though technically a class can hold data too
  • 3
  • 3
    After seeing the question, wanted to check if the post was from India. Yes!
  • 2
    if its from an Indian Uni , I would choose encapsulation.. I know how my teachers think.. -_-
  • 0
    3. Object.
    And funnily enough classes aren't necessary for OOP, you can do OOP just fine without them.
  • 1
    @rgomez We're all apes.
  • 0
    Well, obviously 3.
    Objects contain all class data.
  • 1
  • 1
    Very stupid and unclear question, but it's 3.
  • 2
    @Nawap The others already answered it, but my first thought was a class. Because methods (or procedures) are related to a class, even if they're accessible through an object.

    Ultimately, what makes this a terrible question is the last alternative. One could say it's an object, a class, or even a memory region as @Wack pointed out.

    Anyway, after finding where this question came from and seeing every one had the same "None of these" alternative, I think it was not thought thoroughly.
Your Job Suck?
Get a Better Job
Add Comment