I have an array of seats, and the array has two strings(selected and empty). On mouse click, I want to traverse the array and find the selected seat. When I press the button
Make sure your variable doesn't have the final modifier.
//final, can be set only when the object is created.
private final String seatno;
//no final modifier, the value can be set every time you "want"
private String seatno;
Also, to compare Strings you should use equals:
if(anArray[x].equals("selected"))