• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

dereferencing in java

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have serached on Google but could't find exact concept of derefencing in java,I have few doubt about this concept please clear --

1-is java support derefencing?
2- is Derefencing and aliase is same word?
3- is I am correct if
A a1= new A();
and then later i try to use properties or function of a1

is this called derefencing?
or

if
A a1=new A();
a1= null;
or assigning null to reference is called derefencing?
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sanjay kumar gupta wrote:I have serached on Google but could't find exact concept of derefencing in java,I have few doubt about this concept please clear --

1-is java support derefencing?



Yes.


When we access a member of the object pointed to by member variable x using "x." we say that we are dereferencing the x variable (or dereferencing the reference that's stored in x).

2- is Derefencing and aliase is same word?



No.

3- is I am correct if
A a1= new A();
and then later i try to use properties or function of a1

is this called derefencing?



Yes.

or

if
A a1=new A();
a1= null;
or assigning null to reference is called derefencing?



No.
 
Marshal
Posts: 73019
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aliasing means using two variables to point to the same reference
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Aliasing means using two variables to point to the same reference



<quibble>
I disagree. Variables don't "point to" references. They hold references as their values. In C++, I've heard references referred to as an "alias" for the variable. There's nothing comparable in Java, and I've never heard the term "alias" used to describe that situation.

But perhaps I'm missing out on some (semi-?)standard part of the lexicon?
</quibble>
 
sanjay kumar gupta
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all
 
Campbell Ritchie
Marshal
Posts: 73019
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All right, “point to” was wrong.
 
Your mother is a hamster and your father smells of tiny ads!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic