Two Laptop Bag*
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "inheritance doubt" Watch "inheritance doubt" New topic
Author

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
Bartender

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?

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

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
sscce.org
 
 
subject: inheritance doubt