a == "java"

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
The_Nick

a == "java"

Post by The_Nick »

Ok one more question related to this thread:
Why a=="java"; gives true?

The operator == checks whether or not the 2 variables point to the same object or not. "java" is not a reference variable to nothing is just the content. Why does it work that way?

Thanks in advance.

The_Nick.
Last edited by admin on Sun Mar 10, 2013 10:23 am, edited 1 time in total.
Reason: removed qid reference

admin
Site Admin
Posts: 10066
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1212 :

Post by admin »

The actual content "java" is stored at a location, this location address is compared to a.
Please don't take it wrong way but the questions that you are asking are really basic. You should first study from a good book such as "Thinking in Java". It will help you a lot.
I can only give you brief explanation but you need a continuous development of concepts, which can be done only by reading a book.

thank you,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 236 guests