What is difference between == and & operators

Showing Answers 1 - 7 of 7 Answers

kuldeep bhatia

  • Nov 7th, 2005
 

"==" is the operator which used for assign the value in variable where the other hand "&" is  used for asign the address of variable to another variable!!!!

  Was this answer useful?  Yes

vijaya

  • Dec 16th, 2005
 

"==" operator is used to check whether two OBJECTS are equal. In java for STRING type only they have written implementation for this operator, for other types(int etc) the user have to write implementation. 

"&" is used for performing bitwise operation.

 

  Was this answer useful?  Yes

1. == operator can be used to check two operands can be equal or not
2. & means address operator it stores the address of a variable


Ex:
1. a=20;b=20;
if (a==b)
System.out.println("both are eual");


2.a=55;
b=&a;
System.out.println("address is="+b);


Result: address is=123458adf(address of a)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions