Chris Avala wrote:Hey, Just recently learned hashmap. I'm adding employee information. With sort: It ascends by last name. if they have the same last name, then it ascends by first name. If both employee's have first and last name then it must ascends by ID number. My code does not ascend by ID number, rather it omits the employee who's ID number is greater than the other one. I'm not sure if I have to work on my equals/CompareTo method, or my main method case.
Chris Avala wrote:Hey, I also changed my equals method because it was using "==" rather than equals when using Strings.
I also changed my main method 5th case, the ascending/sort. Still does not work, when I enter the 2nd employee's same first/last name as the 1st employee, it overwrites that person along with their ID & Performance rating. So any help appricated. Codes change:
Chris Avala wrote:Here's my code for my employee class.
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your databasehttps://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database