Advertisement
gonzalob

Untitled

May 17th, 2022
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package app;
  2.  
  3. public class UsuarioIncorrecto extends Exception
  4. {
  5.  
  6.     private int cantidadDeIntentos;
  7.     /**
  8.      * @param message
  9.      */
  10.     public UsuarioIncorrecto(String message,int cantidadDeIntentos) {
  11.         super(message);
  12.         this.cantidadDeIntentos = cantidadDeIntentos;
  13.     }
  14.    
  15.    
  16.     public int getCantidadDeIntentos() {
  17.         return cantidadDeIntentos;
  18.     }
  19.    
  20.     @Override
  21.     public String getMessage() {
  22.         // TODO Auto-generated method stub
  23.         return super.getMessage() + " cantidad de intentos "+getCantidadDeIntentos();
  24.     }
  25.    
  26.    
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement