Advertisement
squidward98

Guia 3 - Ejercicio 1 #1 Autor

Apr 6th, 2020
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1. package ejercicioUno;
  2.  
  3. public class Autor
  4. {
  5.     private String nombre;
  6.     private String apellido;
  7.     private char genero; // M o F;
  8.     private String email;
  9.    
  10.     public Autor(String nombre, String apellido, char genero, String email)
  11.     {
  12.         this.nombre = nombre;
  13.         this.apellido = apellido;
  14.         this.genero = genero;
  15.         this.email = email;
  16.     }
  17.    
  18.     public String getNombre()
  19.     {
  20.         return this.nombre;
  21.     }
  22.    
  23.     public void setNombre(String nombre)
  24.     {
  25.         this.nombre = nombre;
  26.     }
  27.    
  28.     public String getApellido()
  29.     {
  30.         return this.apellido;
  31.     }
  32.    
  33.     public void setApellido(String apellido)
  34.     {
  35.         this.apellido = apellido;
  36.     }
  37.    
  38.     public char getGenero()
  39.     {
  40.         return this.genero;
  41.     }
  42.    
  43.     public void setGenero(char genero)
  44.     {
  45.         this.genero = genero;
  46.     }
  47.    
  48.     public String getEmail()
  49.     {
  50.         return this.email;
  51.     }
  52.    
  53.     public void setEmail(String email)
  54.     {
  55.         this.email = email;
  56.     }
  57.    
  58.     @Override
  59.     public String toString()
  60.     {
  61.         return "Nombre completo del autor: "+this.getApellido()+", "+this.getNombre()+".\n"+
  62.                 "Genero: "+this.getGenero()+".\n"+
  63.                 "email: "+this.getEmail()+".\n";
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement