wood burning stoves*
The moose likes Beginning Java and the fly likes inheritance problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "inheritance problem" Watch "inheritance problem" New topic
Author

inheritance problem

ajithsasi kumar
Greenhorn

Joined: Apr 06, 2008
Posts: 21


the names are displayed as null in the display method of the main class. Why it is not possible to get the values. Sir Help me...
Sandeep Mukherji
Ranch Hand

Joined: Mar 23, 2008
Posts: 46
Make a slight change:


You were using the overrided version of the name in class B. You had to take the name of the Class A only.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Thanks Sandeep
Sandeep Mukherji
Ranch Hand

Joined: Mar 23, 2008
Posts: 46
I said:

You were using the overrided version of the name in class B

Actually you were hiding the field 'name' in your class B. Pardon me for saying 'Overriding'.
ajithsasi kumar
Greenhorn

Joined: Apr 06, 2008
Posts: 21
Thank You 'Sandeep Mukherji' for your reply
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inheritance problem