On Fri, 12 Nov 1999 16:23:08 +0100, Dirk Waxweiler wrote:
>Vector ad = null;
>...
> void readwinners(String winners) throws Exception{
> String a = null, b = null;
> File infile = new File(winners);
> BufferedReader br = new BufferedReader(new FileReader(infile));
> do{
> a = br.readLine();
> System.out.println(a);
> if (a != null) {
> ad.addElement(a);
[...]
>...
>
>result: "java.lang.NullPointerException"
Where do you create the vector? You have an object reference that you
never created an object for and then you try to do a method on the non-object
which is why you get the null pointer exception.
Try changing the ad=null to:
java.util.Vector ad = new java.util.Vector();
--
Michael Sinz ---- Technology and Engineering Director/Consultant
"Starting Startups" mailto:[EMAIL PROTECTED]
My place on the web ---> http://www.users.fast.net/~michael_sinz
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]