嗨,什么是 JAVA 等价于用 C# 类 1 编写的代码和平:
public string Password
{
get { return password; }
set { password = value; }
}
第 2 类:
try
{
UserEntity user = new UserEntity();
user.Password = textBoxPassword.Text;
user.InsertUser();
MessageBox.Show("User is registred");
}
在java中我写了这个:类1:
protected int password ;
public int getPassword(){
return password;
}
public void setPassword(int password){
this.password=password;
}
类 2:
LoginEntity login = new LoginEntity();
login.getPassword() = pwdTextBox.getText();// here ERROR : required variable , found value