Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pointers

 
bharat bhasin
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how are references in java different from pointers in c and c++.
 
Henry Wong
author
Marshal
Pie
Posts: 21115
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't do pointer arithmetic is Java. All you can do, with a Java reference, is dereference it. So, tricks in C, such as calculating a memory location in an array or structure, to be treated as something else, won't work.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic