why i have this Exception?
package Elevator;
import java.util.*;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
publicclass myHashtable{
privatestatic Hashtable hash;
public myHashtable(int Capacity){
hash=new Hashtable(Capacity);
if (Capacity < 0)
thrownew IllegalArgumentException("Illegal Capacity: " + Capacity);
}
public myHashtable(){
hash=new Hashtable();
}
publicstaticint size(){
return hash.size();
}
publicstaticvoid putInBoard(Passenger p,Floor f){
int size =hash.size();
hash.put(p,f);
size++;
System.out.print("the passenger onboard is"+size+"\n");
}
publicstaticvoid main(String []st){
Floor f=new Floor(2);
f.setCurrent(1);
Passenger p=new Passenger(f.getCurrent(),f.getDestination(),"azza");
Passenger p2=new Passenger(f.getCurrent(),f.getDestination(),"maha");
putInBoard(p,f);
putInBoard(p2,f);
System.out.print(p);
System.out.print(p2);
}
}
the exception is NullPointerException at int size =hash.size();
and putInBoard(p,f);

