help!!!

hey, i was having a problem with my code. Everything compiles correctly, but my instance variable methods dont run, it just skips right over them as if they arent they. The other parts of my switch work, just not the methods from my instance variable "ad". Any help would be greatly appreciated. Thanks.

import java.io.*;

import java.util.*;

import java.util.Scanner;// Needed for Scanner class

publicclass AddressBookDriver

{

static String firstName;

static String lastName;

static String streetAddress;

static String city;

static String state;

static String zip;

staticint dMonth;

staticint dDay;

staticint dYear;

static String phoneNumber;

static String personStatus;

static BufferedReader keyboard =new

BufferedReader(new InputStreamReader(System.in));

static AddressBook ad =new AddressBook();

AddressBookDriver ()

{

firstName ="";

lastName ="";

dMonth = 1;

dDay = 1;

dYear = 1900;

streetAddress ="";

city ="";

state ="";

zip ="";

phoneNumber ="";

personStatus ="";

}

publicstaticvoid loadAddressBook (AddressBook adBook)throws

IOException, FileNotFoundException

{

StringTokenizer tokenizer;

String in;

System.out.print ("Enter the file Name: ");

in = keyboard.readLine ();

BufferedReader inFile =new BufferedReader (new FileReader (in));

String input = inFile.readLine();

while (input !=null)

{

tokenizer =new StringTokenizer (input);

firstName = tokenizer.nextToken();

lastName = tokenizer.nextToken();

input = inFile.readLine();

tokenizer =new StringTokenizer (input);

dMonth = Integer.parseInt (tokenizer.nextToken());

dDay = Integer.parseInt (tokenizer.nextToken());

dYear = Integer.parseInt (tokenizer.nextToken());

streetAddress = inFile.readLine();

city = inFile.readLine();

state = inFile.readLine();

zip = inFile.readLine();

phoneNumber = inFile.readLine();

personStatus = inFile.readLine();

input = inFile.readLine();

}

}

// Based on each case... use methods from address book.java

publicstaticvoid saveData(AddressBook adBook)throws IOException,

FileNotFoundException

{

PrintWriter outfile;

String filename;

System.out.println("Enter file name: ");

System.out.flush();

filename = keyboard.readLine();

System.out.println();

outfile =new PrintWriter(new FileWriter(filename));

adBook.saveData(outfile);

}

publicstaticvoid main (String[] args)throws IOException,

FileNotFoundException, Exception

{

AddressBook adBook =null;

int choice;

char optionCase = 0;

loadAddressBook (adBook);

char input;

String lastName2;

choice = showMenu ();

do

{

switch (choice)

{

case 0:

case 1:

{

System.out.println ("Enter the last name of the person: ");

lastName = keyboard.readLine ();

ad.search (lastName);

break;

}

case 2:

{

System.out.println ("Enter the last name of the person: ");

lastName = keyboard.readLine ();

ad.printInfoOf (lastName);

break;

}

case 3:

{

System.out.println ("Enter the month number: ");

dMonth = Integer.parseInt (keyboard.readLine ());

ad.printNameInTheMonth (dMonth);

break;

}

case 4:

{

System.out.println ("Enter starting last name: ");

lastName = keyboard.readLine ();

System.out.println ("Enter ending last name: ");

lastName2 = keyboard.readLine ();

// Print names from starting to ending last names

ad.printNamesBetweenLastNames (lastName, lastName2);

break;

}

case 5:

{

System.out.println ("Enter person type Family, Friend, "

+"Business: ");

personStatus = keyboard.readLine();

ad.printNamesWithStatus (personStatus);

break;

}

case 6:

{

ad.print();

break;

}

case 7:

{

saveData (adBook);

break;

}

case 8:

case 9:

{

System.out.println ("Save data Yes (Y/y) No(N/n)?: ");

String t = keyboard.readLine();

input = t.charAt(0);

if (input =='Y' || input =='y')

{

saveData (adBook);

}

break;

}

default:

{

System.out.println ("That is not a valid response");

}

}

showMenu ();

}while (optionCase != 9);

}

publicstaticint showMenu ()throws Exception

{

int choice;

Scanner keyboard =new Scanner (System.in);

// Switch case to display menu

System.out.println ("Welcome to the address book program."

+"\nChoose amoung the following "

+"options: "

+"\n1: To see if a person is in the "

+"address book"

+"\n2: Print the information "

+"of a person"

+"\n3: Print the names of person "

+"having birthday in a particular month"

+"\n4: Print the names of persons between "

+"two last names"

+"\n5: Print the names of "

+"persons having a particular status"

+"\n6: Print the address book"

+"\n7: Save data"

+"\n9: Terminate the program");

choice = keyboard.nextInt();

return choice;

}

}

[10230 byte] By [javaMana] at [2007-10-2 13:37:58]
# 1
CROSS-POST http://forum.java.sun.com/thread.jspa?threadID=713074&tstart=0
javaMana at 2007-7-13 11:28:27 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...