Originally Posted by
Eranga
You asking that how to implement that method? There have few errors in your code. Try this.
// Collect data from the user
public void getdata() {
Scanner kb = new Scanner(System.in);
System.out.print("Enter Name : ");
name = kb.nextLine();
System.out.print("Enter ID : ");
id = kb.nextInt();
System.out.print("Enter Salary : ");
salary = kb.nextInt();
}
nonono thats not the code i'm referring to.
i'm talking about the FIRST code i have up i need to ADD a getData function with employee1 info in the main() function.