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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:01:38+00:00 2026-05-13T11:01:38+00:00

I have been trying to understand the difference between different references but the theory

  • 0

I have been trying to understand the difference between different references but the theory does not provoke any ideas for me to visualize the same.

Could anyone please explain in brief the different references?

An example for each would do better.

  • 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-13T11:01:38+00:00Added an answer on May 13, 2026 at 11:01 am

    Another good article on the topic:
    Java Reference Objects or How I Learned to Stop Worrying and Love OutOfMemoryError, with nice diagrams

    http://www.kdgregory.com/images/java.refobj/object_life_cycle_with_refobj.gif

    Extract:

    As you might guess, adding three new optional states to the object life-cycle diagram makes for a mess.
    Although the documentation indicates a logical progression from strongly reachable through soft, weak, and phantom, to reclaimed, the actual progression depends on what reference objects your program creates.
    If you create a WeakReference but don’t create a SoftReference, then an object progresses directly from strongly-reachable to weakly-reachable to finalized to collected. object life-cycle, with reference objects

    It’s also important to remember that not all objects are attached to reference objects — in fact, very few of them should be.
    A reference object is a layer of indirection: you go through the reference object to reach the referred object, and clearly you don’t want that layer of indirection throughout your code.
    Most programs, in fact, will use reference objects to access a relatively small number of the objects that the program creates.

    References and Referents

    A reference object provides a layer of indirection between your program code and some other object, called the referent.
    Each reference object is constructed around its referent, and provides a get() method to access the referent. Once you create a reference, you cannot change its referent. Once the referent has been collected, the get() method returns null. relationships between application code, soft/weak reference, and referent

    alt text


    Even more examples: Java Programming: References’ Package

    alt text http://www.pabrantes.net/blog/space/start/2007-09-16/1/referenceTypes.png

    • Case 1: This is the regular case where Object is said to be strongly reachable.

    • Case 2: There are two paths to Object, so the strongest one is chosen, which is the one with the strong reference hence the object is strongly reachable.

    • Case 3: Once again there are two paths to the Object, the strongest one is the Weak Reference (since the other one is a Phantom Reference), so the object is said to be weakly reachable.

    • Case 4: There is only one path and the weakest link is a weak reference, so the object is weakly reachable.

    • Case 5: Only one path and the weakest link is the phantom reference hence the object is phantomly reachable.

    • Case 6: There are now two paths and the strongest path is the one with a soft reference, so the object is now said to be softly reachable.

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

Sidebar

Ask A Question

Stats

  • Questions 258k
  • Answers 258k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Here: ProcessBuilder processbuilder try { processbuilder.directory(file); processbuilder.redirectErrorStream(true); process = processbuilder.start();… May 13, 2026 at 11:02 am
  • Editorial Team
    Editorial Team added an answer Change where (s.crmc_Retail_Trade_Id == tradeId) to where (s.crmc_Retail_Trade_Id == tradeId… May 13, 2026 at 11:01 am
  • Editorial Team
    Editorial Team added an answer I second on the Vici MVC framework! Open source, easy… May 13, 2026 at 11:01 am

Related Questions

I have been trying to understand the use of primitives in Java and C#
I'm trying to accomplish a task and turns out that the code I need
I have been keeping up with .NET CLR for awhile now, and my language
I am a reasonably experienced C# developer (about 5 year experience) that has recently
I'm working on some Python code modeled on Apache's MPM prefork server. I am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.