Possible Duplicate:
How do I compare strings in Java?
I read some records from a csv file and store them into a string type array, then save each field in proper variable after convert them. In a part of code I have to compare a field in array with one of those variables with string type. both these arrays filled from a csv file.
int count=0;
String name=resourceArray[i][j+1] ;
while(machineArray[count][0]==name)
{
machineID=Integer.parseInt(machineArray[count][1]);
machinePe=Integer.parseInt(machineArray[count][2]);
count++;
}
the problem is 'while' condition never become true. I debug it and I'm sure machineArray[0][0] and 'name' have same value.