使用get set提示
The operation is not applicable to the current selection. Select a field which is
not declared as type variable or a type that declares such fields.
看你代码如何写的,好帮你分析。
一个类中要先定义属性,才能生成对应的set/get方法。
class Stutent{
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}