This project is driving me crazy and I need some help.
I would post it here but I have worked so hard on it that I don't want someone else in my class to steal it.
So if I can pm it to someone that would be great.
here is part of my code where I'm having problems.
Problem is at public static void main(String[] args) {
The method main cannot be declared static; static methods can only be declared in a static or top level type..
RedSon told me to look for "The second problem probably comes from using arlist again but I cant be sure because I dont see how arlist is declared."
tried to change that but still I get the error.
Expand|Select|Wrap|Line Numbers
- public class Employee {
- public ArrayList<Employee_listing> employees;// ArrayList of
- // contact
- int empid = employees.size();
- public void createEmployeeDB() {
- employees = new ArrayList<Employee_listing>();
- }
- more code here of course
- public static void main(String[] args) {
- Employee emp = new Employee();
- Scanner kbd = new Scanner(System.in);
- int choice;
- System.out.println("Make a Section: ");
- System.out.println("1. Enter ");
- System.out.println("2. Find ");
- System.out.println("3. Exit ");
- System.out.print("\nPlease press Enter afer each response");
- System.out.println("Enter your chose please: ");
- choice = kbd.nextInt();
- kbd.nextLine();
- if (choice == 1) { // if 1 is select go to makePerson
- emp.inputEmployee();
- } // close the if loop
- if (choice == 2) { // if 2 is select go to find
- emp.displayMatch();
- }// close the choice==2
- if (choice == 3) {
- System.out.printf("Good bye");
- }// close the choice == 3
- }// close public static void
thanks
nomad