Advertisement
gonzalob

Untitled

Mar 28th, 2022
685
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. package app;
  2.  
  3. public class Persona {
  4.  
  5.     private static int lastID = 0;
  6.     private String nombre;
  7.     private int edad;
  8.    
  9.     public int ejemplo;
  10.    
  11.     private Direccion miDireccion;
  12.    
  13.    
  14.    
  15.     /**
  16.      * @param nombre
  17.      * @param edad
  18.      * @param ejemplo
  19.      */
  20.     public Persona(String nombre, int edad, int ejemplo, String nombreCalle) {
  21.    
  22.         this.nombre = nombre;
  23.         this.edad = edad;
  24.         this.ejemplo = ejemplo;
  25.        
  26.        
  27.         this.miDireccion = new Direccion(nombreCalle);
  28.        
  29.        
  30.        
  31.     }
  32.    
  33.     public String getNombreDireccion()
  34.     {
  35.         return miDireccion.getNombreCalle();
  36.     }
  37.  
  38.     /**
  39.      * @param nombre
  40.      */
  41.     public Persona(String nombre) {
  42.    
  43.         this.nombre = nombre;
  44.     }
  45.  
  46.     public static int getLastID()
  47.     {
  48.         return lastID;
  49.     }
  50.    
  51.     private static void setLastID(int lastID) {
  52.         Persona.lastID = lastID;
  53.     }
  54.    
  55.    
  56.     /**
  57.      * @return the nombre
  58.      */
  59.     private String getNombre()
  60.     {
  61.        
  62.         return nombre;
  63.     }
  64.     /**
  65.      * @param nombre the nombre to set
  66.      */
  67.     public void setNombre(String nombre) {
  68.         this.nombre = nombre;
  69.     }
  70.     /**
  71.      * @return the edad
  72.      */
  73.     public int getEdad() {
  74.         return edad;
  75.     }
  76.     /**
  77.      * @param edad the edad to set
  78.      */
  79.     public void setEdad(int edad) {
  80.         this.edad = edad;
  81.     }
  82.    
  83. }
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement