10.05.2014 Views

programación i - Universidad ORT Uruguay

programación i - Universidad ORT Uruguay

programación i - Universidad ORT Uruguay

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Programación I 129<br />

//Clase Cliente<br />

package llevaTrae;<br />

public class Cliente {<br />

// Variables de instancia<br />

private int numero;<br />

private String nombre;<br />

private String direccion;<br />

private String telefono;<br />

// Constructor<br />

public Cliente() {<br />

this.setDireccion("Sin Dirección");<br />

this.setNombre("Sin nombre");<br />

this.setNumero(0);<br />

this.setTelefono("No tiene telefono");<br />

}<br />

// acceso y modificación<br />

public String getDireccion() {<br />

return direccion;<br />

}<br />

public String getNombre() {<br />

return nombre;<br />

}<br />

public int getNumero() {<br />

return numero;<br />

}<br />

public String getTelefono() {<br />

return telefono;<br />

}<br />

public void setDireccion(String unaDireccion) {<br />

direccion = unaDireccion;<br />

}<br />

public void setNombre(String unNombre) {<br />

nombre = unNombre;<br />

}<br />

public void setNumero(int unNumero) {<br />

numero = unNumero;<br />

}<br />

public void setTelefono(String unTelefono) {<br />

telefono = unTelefono;<br />

}<br />

// Redefinición de métodos<br />

@Override

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!