Hi Geeks,
I dont know whats the wroing with the below code.... I am getting input from textbox and putting the input in a string. If the textbox is empty it will return a empty string. In the below code
String[] str = new String[9];
for(int i=0;i<9;i++){
if(str[i].equals("")){
System.out.println("set " + cmds[i] + " " + str[i]);
WriteThread.sendCommand("set " + cmds[i] + " " + str[i] + "\n", false);
}
}
In the above code str[i] stores the input text of textboxes and I am trying to check if any element of array is empty.I also tried with str[i] == "" and str[i] == null. But no luck. The statement inside the if block if i am printing the string str[i], it shows nothing that means it is empty.
Am I doing anything wrong way? Can anybody please suggest?