This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
 
subject: inheritance problem
 
Similar Threads
please help with simple problem
comparing elements in one hash set to the elements in another
copying arrays - please h e l p!
writer's block on assignment, any help?
Array IndexOutOfBounds Exception