The Artima Developer Community
Sponsored Link

Java Buzz Forum
Instance Variables Hiding

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Goldy Lukka

Posts: 1008
Nickname: xyling
Registered: Jan, 2004

Goldy Lukka is a Java Developer and an Entrepreneur. He is Founder of xyling.com.
Instance Variables Hiding Posted: Sep 15, 2004 12:46 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Goldy Lukka.
Original Post: Instance Variables Hiding
Feed Title: Xyling Java Blogs
Feed URL: http://www.javablogs.xyling.com/thisWeek.rss
Feed Description: Your one stop source for Java Related Resources.
Latest Java Buzz Posts
Latest Java Buzz Posts by Goldy Lukka
Latest Posts From Xyling Java Blogs

Advertisement
If methods with the same signatures or member variables with the same name exist in ancestor and descendant classes, the Java keyword super allows access members of the ancestor. But what if you do not use the keyword super in the descendant class? In case of methods, this is called method overriding and only the code of the descendant's method will execute. But when both classes have a member variable with the same name, it may cause a confusion and create hard to find bugs.

Author Yakov Fain has written an article (code samples included) for workaround. Refer to the title of this post

[Resouce-Type: Tips; Category: Java/J2SE; XRating: 3]

Read: Instance Variables Hiding

Topic: [Sep 2, 2004 11:07 PDT] 10 Links Previous Topic   Next Topic Topic: DynamicBlock - Choosing Tapestry Components at Runtime

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use