private String userName;//用户姓名
public void setUserName(String userName){
this.userName=userName;
}
public String getUserName(){
return userName;
}
另一个类中
package example;
import info.User;
class UserDemo{
UserDemo wangLiLi=new UserDemo();
wangLiLi.setUserName("王丽丽");
为什么 这样赋值不对?