Skip to content

j143/java-capstone-01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-capstone-01

HR App to print Employee and Department information

public class HRApp {
    public static void main(String [] args) {
        System.out.println("test harness");
        Employee Jason = new Employee(21, "Jason", 20000.02);
        Employee Clarice = new Employee(23, "Clarice", 23000.10);
        System.out.println(Jason.toString());
        System.out.println(Clarice.toString());

        Department department1 = new Department("Physics");
        department1.addEmployee(Jason);
        department1.addEmployee(Clarice);
        department1.getAllEmployees();

    }
}

issues

output

Employee: 71 Clarice 23000.1
Employee: 71 Clarice 23000.1
Employee: 102 Mathison 40000.0
Employee: 102 Mathison 40000.0
Employee: 102 Mathison 40000.0
Employee: 102 Mathison 40000.0
120000.0
40000.0

Only the last added element is available. Something to do with static keyword.

About

HR App to print Employee and Department information

Topics

Resources

Stars

Watchers

Forks

Languages