case1、case2 和 case3 之间有什么区别吗?是否有与性能相关的优势或劣势?
public class Test {
private String name;
public void action (){
name = doSome(); // case 1
setName(doSome()); // case2
this.name =doSome(); // case3
}
public String doSome(){
return "Hello";
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
}