This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes inheritance doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "inheritance doubt" Watch "inheritance doubt" New topic

inheritance doubt

lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
how do i code 2 java file that has inheritance. for example message, reply. reply will inherit from message. i know have to use extends. but how do pass variable?
pete stein

Joined: Feb 23, 2007
Posts: 1561
For general OOPs and inheritance, you can check out this site and this site as well as about umpteen million other tutorials online.

Or are you asking a specific question on inheritance?

[ March 17, 2007: Message edited by: pete stein ]
marc weber

Joined: Aug 31, 2004
Posts: 11343

Inheritance is as simple as telling the compiler which class to extend (inherit from)...

At that point, a Reply IS-A Message.

I don't understand what you mean about passing variables. Can you be more specific?

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
I agree. Here's the link:
subject: inheritance doubt
It's not a secret anymore!