Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8544269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:30:59+00:00 2026-06-11T12:30:59+00:00

Why declaration of a field in the subclass with the same name as the

  • 0

Why declaration of a field in the subclass with the same name as the one in the superclass in not recommended? It is stated here. What this hiding can lead to? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:31:00+00:00Added an answer on June 11, 2026 at 12:31 pm

    Well, there are two issues here:

    • The confusion of one field hiding another
    • The confusion of having two pieces of state which presumably mean very similar things

    The first point is easily alleviated by simply keeping fields private, which is generally a good idea anyway. However, the second point is arguably more important. If you’ve got two fields both called name (for example) in the same object, even if no single piece of code is aware of both fields, that suggests that either there are genuinely two kinds of name within that object, in which case it would be helpful for at least one of the field names to be more specific, or you’ve got two fields representing the same piece of state, which is very fragile, as well as inefficient. (It’s all too easy to change one but not the other, for example.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one Pojo class in which I create one field which is not
Im not sure why I am getting this error...error: field 'config' has incomplete type.
On this declaration: string[] TardyEvenEmorys; ...Resharper tells me, Field 'TardyEvenEmorys' is never assigned. Later
Here is the field declaration in a form: max_number = forms.ChoiceField(widget = forms.Select(), choices
Assign value to field at the same time with field declaration Assign value to
following this MSDN article a CHOICE Element in a field declaration for SharePoint should
Declaration;) MKMapView mapView; I can't found the difference between mapView.userLocation.location.coordinate and mapView.userLocation.coordinate. Is there
declaration of textfield1 <td nowrap=nowrap><input type=text name=textfield1 id=textfield1/></td> trying to return the value entered
Declaration: I am not sure if that is a parameter. Please enlighten. I have
This is the properties declaration: @property (atomic, weak) zooView* zooView; This is my custom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.