I have setters and getters to receive an employee's name and can run the program fine when I set the name as something, but have trouble receiving a name from the user?
Constructor class:
main class
Constructor class:
public class employeeName {
private String name;
public String showName ( ) { //do I need to put a getLine or scanner here?
return name;
}
public String setName(String Name) {
name = Name;
return Name;
}
}
main class
public class employeeInformation
{
public static void main ( String [ ] args ) {
employeeName n1 = new employeeName ( );
n1.setName ( );//not sure what to put here
System.out.println ( "The employee's name is " + n1.showName ( ) );
}
}