This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java has pointer concept? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java has pointer concept?" Watch "Java has pointer concept?" New topic
Author

Java has pointer concept?

Chan Lee
Greenhorn

Joined: Sep 02, 2008
Posts: 25
Hi friends,

Is Java has pointer concept? If so, how to declare and use?

If not,
1) why Java does not posses this feature?
2) It is also OOPs based language. Then, why C++ has and why not Java has?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 20057
    
  44

Java has references -- which is just like pointers except you can't do arithmetic on it.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11861
    
  18

This looks an awful lot like a homework question. We try very hard to not hand out answer, but help you figure out the answer on your own. So, what has your own research uncovered? What exactly do you mean by "pointer concept"? Do you mean 'a variable that refers to something else'? Are you talking about pointer arithmetic?

Your second question makes less sense. Yes, Java is an OOP language - but what does that have to do with pointers? C has them and is definitely NOT OOP. I'm sure there are other languages that don't have them that are OO


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
Have you checked out Aspose?
 
subject: Java has pointer concept?
 
jQuery in Action, 3rd edition