This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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: 18505
    
  40

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: 11152
    
  16

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
 
jQuery in Action, 2nd edition
 
subject: Java has pointer concept?
 
Similar Threads
What is "this" in Java ?
Pointer in Java
Null Pointer Exception
String Problem
why java doesnot support Multiple Inheritance in classes?