Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Estu {
- private String nombre;
- private int cal;
- public String getNombre() {
- return this.nombre;
- }
- public int getCal() {
- return this.cal;
- }
- public void setNombre(String nombre) {
- this.nombre = nombre;
- }
- public void setCal(int cal) {
- this.cal = cal;
- }
- public static void main(String[] args) {
- Estu est1 = new Estu();
- Estu est2 = new Estu();
- est1.setNombre("Juan");
- est1.setCal(6);
- est2.setNombre("Benjamin");
- est2.setCal(8);
- System.out.println(est1.getNombre() + ", " +
- est2.getNombre());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement