|
| Total Answers and Comments: 9 |
Last Update: June 14, 2008 |
|
| | |
|
No best answer available. Please pick the good answer available or submit your answer. | |
September 15, 2005 08:14:01 | #4 |
| Archana |
|
Member Since: September 2005 Contribution: 3 |
RE: What is the difference between == & .equals
| == is used to compare the number type data types viz. int, float,double and also the boolean datatypes. e.g. int x=10; if(x==10) { // your code } boolean flag = true; if(flag==false) { // Action1 } if(flag==ture) { //Action2 } .equals() method is used to compare the String data types viz. String str = "Hello"; if(str.equals("Hello")) { // Your code of action } |  | | Is this answer useful? Yes | No | | |
|
| |
|
October 03, 2005 02:50:41 | #7 |
| mehar |
|
|
RE: What is the difference between == & .equals
| The difference between == and .equals is String a="john",b="joi"; if (a.equals(b))// it compares internaly for the same materials if(a==b)// it compares for the memory location |  | | Is this answer useful? Yes | No | | |
|
| |
Go To Top
|