Linked by Bjorn Raupach on Thu 17th Jul 2008 06:01 UTC
Thread beginning with comment 323508
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[4]: Never programmed in Java before...
by ebasconp on Thu 17th Jul 2008 21:01
in reply to "RE[3]: Never programmed in Java before..."
"[q]Java doesn't have pointers.
Sure java has pointers. You just can't manipulate them.
E.g.:
Object a=new Object(), b=a;
Here a and b are pointers to the same object. "
To a C++ programmer, a and b look a lot more like references than pointers... [/q]
No, they are not references, they are pointers. The code above is identical to:
Object* a = new Object(), *b = a;
a and b are pointers to the same object.
References in C++ are stuff defined as:
const Object& a = Object::GetSingleton();
a is a const reference to an instance of a class.




Member since:
2006-02-01
Sure java has pointers. You just can't manipulate them.
E.g.:
Object a=new Object(), b=a;
Here a and b are pointers to the same object. "
To a C++ programmer, a and b look a lot more like references than pointers...