Advertisement
Guest User

person

a guest
Mar 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. package person;
  2.  
  3. public class Person {
  4.  
  5.    
  6.     protected int id;
  7.     private String name;
  8.    
  9.     public Person(int id, String name) {
  10.         super();
  11.         this.id = id;
  12.         this.name = name;
  13.     }
  14.    
  15.    
  16.    
  17.     public int getId() {
  18.         return id;
  19.     }
  20.     public void setId(int id) {
  21.         this.id = id;
  22.     }
  23.     public String getName() {
  24.         return name;
  25.     }
  26.     public void setName(String name) {
  27.         this.name = name;
  28.     }
  29.    
  30.     protected void show(int d)throws Exception {
  31.         System.out.println(this.name);
  32.        
  33.        
  34.         throw(new ArrayIndexOutOfBoundsException("invalid"));
  35.        
  36.        
  37.     }
  38.    
  39.    
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement