当前位置: 技术问答>java相关
how to compare two string
来源: 互联网 发布时间:2017-03-11
本文导语: String a = "school"; String b; b gets value from program. how to compare a and b, I use "if", if(a == b) but it failed. | try a.equals(b) | try a.equals(b)
String a = "school";
String b;
b gets value from program.
how to compare a and b,
I use "if",
if(a == b)
but it failed.
String b;
b gets value from program.
how to compare a and b,
I use "if",
if(a == b)
but it failed.
|
try
a.equals(b)
a.equals(b)
|
try
a.equals(b)
a.equals(b)