idea怎么快速生成get set方法
参考文章:IntelliJ IDEA生成get/set方法的快捷键是什么
1、生成某个get set方法alt+enter
快捷键:alt+enter
2.生成整个类或者某个get set方法alt+insert
快捷键:alt+insert
点击后,会出现下图弹窗,你可以多选或者单选这些属性对象,然后点击ok
完整代码
public class UserModel {
private int id;
private String name;
private int age;
private String address;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
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;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
标签:set,String,get,int,age,快捷键,id,public
From: https://blog.csdn.net/cplvfx/article/details/142088559