如何使用 If 条件比较两个自动完成文本视图

How to compare two auto complete text view by using If condition

我创建了两个数组,其中存储了两个字符串值数组,现在我想使用 if 条件进行比较,请帮助我。

我喜欢这个....

String[] source={"Chennai","Bangalore","Hyderabad"};

String[] destination={"Chennai","Bangalore","Hyderabad"};

if(source[0] == "Chennai" && destination[2] == "Hyderabad") {
      //Here i want to print some thing  
}

试试这个:

if(source[0].equals("Chennai") && destination[2].equals("Hyderabad"))
  {
      Here i want to print some thing  
  }