• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Example for OOPs concepts

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
To explain all the concepts of OOPs princples, can any one suggest an example ( to a computer science student).
I think some thing like Car or Animal can be used as an example to explain all the three princples of OOPs concepts.
Any suggests will be helpful,
Thanks
Regards
Jyothy
PS: Since Java is based on OOPs concept, I posted this here.
 
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Encapsulation is the 1st principle of OOP. Client Oriented Design is the 2nd.
But I do not remenber the 3rd and the details of these
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey sui, jyothy is asking an example for three principles and not the three principles...
BTW 3 principles on which oops is based on are.
encapsulation, inheritance and polymorphism..
A Car radio is the best example for explanning all of these 3 concepts.
 
shalini sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
will Stack be a good example for explaining th OOps concepts.
The variables are declared as private and Push and Pop are declared as public methods to access the data ( Encapsulation).
Defining different kinds of stacks ( Integer, float, char)( Inheritance and polymorphism)
Thanks
Jyothy
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jyothy kidambhi:
Hi All,
To explain all the concepts of OOPs princples, can any one suggest an example ( to a computer science student).


Other than the humble PIE , there are lot more to OOPS like abstraction, service definition(interfaces), object interaction etc... which cant be defined in a single example.


I think some thing like Car or Animal can be used as an example to explain all the three princples of OOPs concepts.


i would strogly suggest that giving an example of real time will lead them to the wrong way of thinking inheritance,IMHO. try to start with an existing concept like a stack, analyze the issues with procedural design and build on that to an object. just saying A is B, A is composed of A1,A2 etc... is not a big deal but knowing how to make "objects interact" is the essence and abstracting the concept in the object is the real one.
reply
    Bookmark Topic Watch Topic
  • New Topic