answersLogoWhite

0


Best Answer

Java does not have the concept of Reference Variables. We cannot access the memory location where the data is stored in Java.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the differences between C and Java reference variables?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

In java all variables declared using a class are?

Reference variables


Explain reference variable and how it is different from pointer variable?

In JAVA, all variables are reference variables, and there are no pointer variables. Even though the platform may implement them as pointers, they are not available as such. In C, no variables are reference variables. They are a C++ enhancement. In C++ a reference variable is syntactically the same as a pointer variable, except that the use of the indirection operator (*) is implicit. You do declare reference variables slightly differently than pointer variables but, once you do so, they can be treated as non-pointer variables. Reference variables also cannot be redefined once they have been initialized to point to some object. They are const. Structurally, there is no difference between a pointer variable and a reference variable. They are both still pointers. The compiler just makes it easier to treat reference variables and non-pointer variables the same way.


Can object extends?

objects are instances of class only and moreover objects are object reference variables extension of variables is meaningless so objects in java can't be extend


Does java support call by reference?

No , Java does not support call by reference.


WAP to show the difference between a variable and static variable?

difference between constant and static variables in java


Does java consider the variables Hello and hello to be different variables?

no


Why there are no global variables in java?

Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:The global variables breaks the referential transparencyGlobal variables creates collisions in namespac


What is the syntax of global variable in java?

There's no global variables in Java.


What is the difference between reference and hashcode?

There is no relation between reference and hascode, Java reference is unique pointer which refers an object. so each object will have a unique reference. but 2 diff object can have same hashcode.


How we can get address of variables in Java as pointer variables in C?

At any given point of time you cann't get the address of a variables of java program. This is meant for security purpose only.


Are static variables serialized in java?

No, static variables are not serialized.


Differences between pass by value pass by reference in java?

pass by value is the technique where a copy of the variable is passed to the method as argument. This value can be modified inside the method but that would not affect the original value. Pass by reference is the technique where the reference to the actual variable is passed to the method as argument. Any changes to this variable would affect and alter the original value. Usually primitive data types are passed by value and objects are passed by reference in java.