请教:关于String的声明~~
public class test {
public static void main(String args[]) {
String a = "asdf";
String b = "asdf";
// String a = new String("asdf");
// String b = new String("asdf");
if (a == b)
System.out.println("Equal!");
else
System.out.println("Not equal!");
}
}
String a = "asdf";与String a = new String("asdf");有什么区别呢??
谢谢了~~~