在Eclipse中用快捷键写一个Student类
方法及步骤
(1)写出以下程序
public class Student {
private String name;
private int age;
}
(2)Ctrl+Shift+s——c
(3)Ctrl+Shift+s——o
(4)Ctrl+Shift+s——r
(5)展示结果
public class Student {
private String name;
private int age;
public Student() {
super();
// TODO Auto-generated constructor stub
}
public Student(String name, int age) {
super();
this.name = name;
this.age = 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;
}
}