The Artima Developer Community
Sponsored Link

Java Answers Forum
java

2 replies on 1 page. Most recent reply: May 29, 2007 2:17 AM by Kiran Kumar

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
richa dhingra

Posts: 17
Nickname: quest123
Registered: May, 2007

java Posted: May 15, 2007 3:59 AM
Reply to this message Reply
Advertisement
Hi! Anyone knows about gud definition of reference variables


Vikas Saini

Posts: 2
Nickname: bikka
Registered: May, 2007

Re: java Posted: May 22, 2007 11:42 PM
Reply to this message Reply
Reference variable is the second name of a variable. you can use that reference var in the same way as that of simple variable. and you can even Access and Modify the Original value even if the reference is located within a different scope.
now why we need reference variable...
1. Effeciency gain as we don't need to make another copy of it.
2.for safety.. no need to chk whether it is initialized to NULL.

One problem is that when you use references, it's not clear that the memory backing the reference needs to be deallocated

Kiran Kumar

Posts: 12
Nickname: k3
Registered: May, 2007

Re: java Posted: May 29, 2007 2:17 AM
Reply to this message Reply
Hi

Java classifies its variables into 2 types.

1) Primitive type
2) Reference type

A reference variable holds a bit-pattern that (somehow) points to an object or points to null value. It holds an object and an object can be accessed through reference.

Flat View: This topic has 2 replies on 1 page
Topic: java Previous Topic   Next Topic Topic: Dynamic Adverts - Don't you just hate them!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use