Código fuente:
public class frist {
String name;
int age;
}
- Alt + shift + S + R genera los métodos setxxx () y getXXX ().
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the age
*/
public int getAge() {
return age;
}
/**
* @param age the age to set
*/
public void setAge(int age) {
this.age = age;
}
- Alt + shift + S + C genera un método de construcción sin parámetros.
public frist() {
super();
// TODO Auto-generated constructor stub
}
- Alt + shift + S + O genera un método de construcción parametrizado.
public frist(String name, int age) {
super();
this.name = name;
this.age = age;
}
- Alt + shift + S + S Anula el método toString ().
@Override
public String toString() {
return "frist [name=" + name + ", age=" + age + "]";
}