• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hiding Example  RSS feed

 
kayanaat sidiqui
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I just read the difference between hiding and
overridding.here.

It was really nice.

But i want to know some example where it is already used or some situation where
it is benefitial to use hidding.

can you?

Thanks.

 
Harshit Rastogi
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Static methods are typically used for utility classes. Consider Math class though the class is final but all methods are static and doesnt needs an instance to access methods. If in case it had not been I can extend Math class and shadow or hide the method of Math class and implement mine in the custom class.

Overriding is done for instance methods and you can take any example in real world...
Like


 
kayanaat sidiqui
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Harshit.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!