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

  • SEARCH
  • Home
  • 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 8728609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:40:46+00:00 2026-06-13T08:40:46+00:00

I am aware of the concept called field hiding in java. But still I

  • 0

I am aware of the concept called field hiding in java. But still I am having a confusion in relation to instance variable being not over-ridden.

According to my present knowledge, overriding a method of super-class means that the JVM will call the sub-class’s over-ridden method though the super-class’s method is available to the sub-class.

And I read the similar thing for field hiding via the link:- Hiding Fields

So, in any case we are over-ridding the instance if we change the values of the inherited instance variable in the sub-class.

I am confused please help.


I am using the following super-class:-

public class Animal{
File picture;
String food;
int hunger;
int width, height;
int xcoord, ycoord;

public void makeNoise(){
.........
}

public void eat(){
.............
}

public void sleep(){
..........
}

public void roam(){
.............
}

}

It has sub-classes like Tiger, cat, dog,hippo etc. The sub-classes over-ride the makeNoise(), eat and roam() method.

But each sub-class also uses a different set of values for instance variables.

So as per my confusion, I am kind-of overriding all the instance variables and 3 methods of the super-class Animal; and I still have the super-class instance variables available to the sub-class with the use of the super keyword.

  • 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-13T08:40:47+00:00Added an answer on June 13, 2026 at 8:40 am

    It means if you call a method in a superclass it will resolve to the overriden version in a subclass (if your instance is a subclass). However a reference to a member variable will be bound to the declaration of that variable in the class from which the call is made.

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

Sidebar

Related Questions

I aware that this will be a less programming question, but still... How can
I am aware that MySQL and PostgreSQL[1] do not have that concept, so I
I'm aware of using custom configuration values for my custom services, but what if
I am aware that System.Threading.Timer exists, but I already have a Thread. This thread
As I'm currently learning Django / Python, I've not really been using the concept
having a TTTableViewController instance, I try to set the background of the currently selected
My question is rather simple. I'm aware of the concept of a UUID and
This question perhaps has been answered earlier, but I did not see an answer.
I am aware that this had been asked MANY times, but i've spent a
I know the concept of OOP for couple of years and I'm aware of

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.