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 7078769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:35:18+00:00 2026-05-28T06:35:18+00:00

I was talking with my teacher, and she mentioned that an object variable (she

  • 0

I was talking with my teacher, and she mentioned that an object variable (she means an instance of an object) did not contain the object itself, but rather the address in memory.

I’ve heard that in Java, an instance of an object really contains a reference to an object in memory. Am I wrong? Is a reference the same thing as containing the address in memory, or something else?

  • 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-05-28T06:35:19+00:00Added an answer on May 28, 2026 at 6:35 am

    An object variable isn’t the same as an instance of an object. It’s really important that you distinguish between variables, their values, and objects.

    For example:

    String x = "hello";
    

    The variable is x. It’s like a piece of paper, which can have a value written on it.

    The value of the variable is a reference – some data that the VM can use to get to the string object itself. It doesn’t have to be an address – it’s just “a way of getting to the object data”. (For more on this, read Eric Lippert’s blog post “References are not addresses” – that’s talking about C# rather than Java, but it’s the same principle.)

    The object itself is a separate entity.

    To use a real-world example, imagine I have a piece of paper with my home address written on it. There are clearly three things here:

    • The piece of paper (like a variable). The piece of paper itself isn’t my home address, nor is it a house. It’s just something which can store a value.
    • My home address isn’t a piece of paper, nor is it a house. It’s just a value which lets someone get to my house.
    • My house is neither a piece of paper, nor an address in itself. It’s an object.

    This becomes important when you consider things like parameter passing and variable assignment. For example:

    House x = new House("Jon");
    House y = x;
    

    Here we have two variables, x and y, like two pieces of paper. We build a house, and write down the directions to it on x. We then copy the value that’s written on x into y. Note that they’re still completely separate bits of paper – but they currently have the same value written on them. There’s only a single object – we’ve only built one house – but now two pieces of paper have the same directions on them.

    If one person followed the directions on piece of paper x and painted the front door red, then a second person followed the directions on piece of paper y, they’d find a house with a red front door.

    On the other hand, if one person scribbled out the directions on piece of paper x, that wouldn’t affect the directions written on piece of paper y at all.

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

Sidebar

Related Questions

My Java teacher (High school course) was talking about loops and she said that
I'm obviously not talking about a full solution, but just a good starting point
I'm not talking about tools that let one view a page in combinations of
I'm not talking about in the URL. I know what that does. I'm talking
I’m taking a C++ class, and my teacher mentioned in passing that the typename
I am taking classes on intro to AI,and the teacher mentioned some point that
Talking about javax.crypto.Cipher I was trying to encrypt data using Cipher.getInstance(RSA/None/NoPadding, BC) but I
What I'm talking about here are nested classes. Essentially, I have two classes that
I'm not talking about bug tracking software (like Bugzilla or Jira). I'm looking for
Recently a teacher said PHP isn't a real programming language, but only gave, in

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.