• 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

Concept

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,
I am new in OOP. I want to know the difference between OOA,OOD & OOP. Also I want to know the diff between Extend, Abstract,Parent, Child, SuperClass and subclass(by an example if possible)
Thanks in advance,
angela
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OOA - Object Oriented Analysis
OOD - OO Design
OOP - OO Programming
these are diffrent stages in a s/w life cycle. In different stages, u can apply OO.

Originally posted by Angela Jessi:
HI,
I am new in OOP. I want to know the difference between OOA,OOD & OOP. Also I want to know the diff between Extend, Abstract,Parent, Child, SuperClass and subclass(by an example if possible)
Thanks in advance,
angela


 
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Parent - The base class.
Child - The child class extends the base class.
The idea is to have on class extend the other. If class B extends A, B can do everything A can do, and more. So if A has 3 methods and 2 variables, so will B (the programmer only needs to say that class B extends class A, he does not need to rewrite the methods). We B class B inherits from class A. B may then add in more methods and variables. B can also change the behavior of the methods, this is known as overridding methods.
Abstract classes are those which of which you can never get a real instance. The are only general ideas, and placeholders in the class hierarchy. You can't say "new MyAbstractClass()" as you could with other classes.

General example. I might have an Animal class. All Animal objects have certain properties, like weight. Animals also have a method eat().
I could then subclass the Animal class, specifically, "class Cat extends Animal". (Cat subclasses Animal; Animal is the parent of Cat; Cat is the child of Animal.) Cats can eat and have a weight. Cats also have a method called purr(). Ths is something only Cat objects can do, and not Animals. I can also create a Dog class, like a Cat class, it extends Animal. Dogs have a method bark(). Cats cannot bark(). Dogs cannot purr(). Dogs do have weight and can eat().
Unlike Cat, there is no Animal in nature. It's just a concept. I would never say, "there's an animal" wihout being able to subclass it futher (cat, elephant, etc). So I would make my animal class abstract, so the program could never create something that is only an animal class, but nothing more.

Best bet is to go to your local book store, and grab a basic Java book. Chapter 2 or 3 is always an intro to Object Oriented Programming.

--Mark
hershey@vaultus.com
 
Ranch Hand
Posts: 1874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Angela , it seems that you want to learn oops. there are many good books available to start with. There are many threads on the topic in this forum. Please go through them & you will find many books. Plus on net , you will find many good resources .
I hope this can be useful.
Your Friendly Bartender
Shailesh.
 
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Angela,
Please visit Cetuslinks.org.I started learning OO from there.
Hope this helps,
Sandeep
[This message has been edited by Desai Sandeep (edited May 23, 2001).]
 
reply
    Bookmark Topic Watch Topic
  • New Topic