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);

[2798 byte] By [student14a] at [2007-10-2 15:55:58]
# 1
cross posted in a few places but answered here: http://forum.java.sun.com/thread.jspa?threadID=721363&messageID=4160978#4160978
atmguya at 2007-7-13 16:14:29 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...