• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inheritance of Static Members  RSS feed

 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys, does Java impose any sort of restriction regarding overriding or overloading static members of a superclass? And the other way around: can a subclass override or overload a member and make it static?
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The rules about overloading are pretty minimal. Should be able to overload static methods.

Static methods aren't overridden they are hidden. This is in the SCJP FAQ - static override.
[ February 10, 2005: Message edited by: Carol Enderlin ]
 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the explanation and the link!
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may also want to use the search tool to find previous discussions on this topic. Be sure to search the beginner forum as well as this one. Questions about static members and inheritence are quite common in both places.

Layne
 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just passed the SCJP1.4 exam and wanted to post this appreciation note to thank everyone who helped me understand Java a little better. Without your help this personal achievement wouldn't be possible.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!