"The method inputEmployee cannot be declared static; static methods can only be declared in a static or top level type"
Part of my code where the problem is occurring.
Expand|Select|Wrap|Line Numbers
- public class Employee {
- static ArrayList<Employee> arlist;
- int empid = arlist.size();
- /**
- * displayMatch inputs a keyword from the user. It then iterates through the
- * ArrayList of Employees and outputs each one to the screen if the Employee
- * information contains the keyword.
- */
- public static Employee inputEmployee() {
- Employee temp = null;
- //prompt for data
- Scanner input_flag = new Scanner(System.in);
- System.out.println("Enter Employee Id Number AB1234==>");
- String empid = input_flag.next();
Here is the other half of the problem
"The method main cannot be declared static; static methods can only be declared in a static or top level type"
part of my code
Expand|Select|Wrap|Line Numbers
- public static void main(String[] args) {
- arlist = new ArrayList<Employee>();
- kbd = new Scanner(System.in);
- int choice;
- System.out.println("Make a Section: ");
thanks
sandy