Oops concept with real world example and with code ?

hi friends

i have faced three interview and oops concepts are asked there with the real life example and implement in coding. i told them all concept theoretically but could not implemented practically and because of that i was not selected . so please explain me oops concept with practical example. so it would be more helpful for me and other crazyengeers.

thank you in advance

Replies

  • Anoop Kumar
    Anoop Kumar
    There are numbers of concepts on which interviewer would have asked you for practical example.
    Let's start one by one.
    Tell what was the question and what you have answered?
    I am sure people here will answer you in detail and your counter questions.

    Do not shy everyone is crazy here😨
  • rahul69
    rahul69
    hare singh nayak
    hi friends

    i have faced three interview and oops concepts are asked there with the real life example and implement in coding. i told them all concept theoretically but could not implemented practically and because of that i was not selected . so please explain me oops concept with practical example. so it would be more helpful for me and other crazyengeers.

    thank you in advance
    As iAnoop said, it is better if u can give question which were asked and what u answer, so that a healthy discussion can be carried out on it.
    But still, I will give u an example:
    Suppose in real life I take a ball as an object (classical example 😉 ).
    In real life ball has attributes (size, weight, color etc.) and behaviour (bounces, squeezes etc. ).
    Similarly in programming u can implement it by:
    • Creating a class ball which creates objects of ball type
    • Creating instance variables in class as size, weight etc. to represent attributes (or u may call it as state).
    • Creating functions (or methods 😁 ) eg. bounces , squeezes etc. to represent it's behaviour.
    • And different types of constructors ( as per need 😛 )
    As class is ready, simply create objects of ball class and call functions as per need, and u have a practical example of OOPS concepts,
    NOTE: Do keep in mind to mention other Oops concepts which are to be implemented, eg. How encapsulation and abstraction are working in this example(more on this later),
    but first tell what questions u actually faced and how u faced those ☕
  • Nayan Goenka
    Nayan Goenka
    This is a good example of OOPs concept. OOP is all about defining things with the point of view of its attributes, behavior, its functions and its utility. If you can fit anything in this, it can be quantified as application of OOPs

You are reading an archived discussion.

Related Posts

It is difficult to render cloth accurately in presentations, especially if it is textured, shiny, multicolored or self patterned. Google software engineer Iman Sadegi seems to have solved this by...
which is the best efficient and rate less weathering course available?
Well all you folks out there who have started your own businesses or are planning on starting one, should take a look at this page. HostGator and Google have combined...
Nokia Windows Phone 8 users can finally rejoice as the much awaited Lumia Amber update has been delivered to Indian users. The update is now available for download only for...
It seems the Finnish brand is ready to enter the Quad-core dimension. With the recent launch of Lumia 725, a jumbo model with a 4.7-inch screen, Nokia plans to increase...