I created an array of objects and placed them in a treemap. from the treemap, i have to print the items in the collection from a method and without a method. I have to get user input to get and remove an employee from collection. (I have to use id as key) But this code is not working, if someone can look at it and point me in the right direction, i would appreciate it.
If anyone can please.....look at this and help i will be forever grateful..
Hey Maulin, Thank you When I put that in it allowed me to print my array, however it's printing them twice. I tried commeting out each of my methods to see if I could get any of them to work it said "Statement Expected"...do you know what this message means?? EmployeeMap.java :55: Statement expected. public void getName(map m) ^
If the compiler is telling you that it expected a statement, then it expected a statement where it found something else. Perhaps you've a problem with brackets. According to Roedy Green's List of Java Error Messages, you may be missing missing a } in a method.
I have checked and double checked all of my brackets. Am i passing the right paramater to my methods? I think I should pass my collection, in order to iterate over to get the user input? Am I anywhere on the right track.
Following is my updated code. It seems as usual once something is fixed you get 10 more errors. I don't think I understand implementing treemaps much. I'm getting error messages like When I try to pass my map collection to the method it tells me incorrect type-- When I try to cast it as an Object it tell's me explicit cast needed to convert? Also things like getValue() not a method of class java.lang.Object--I thought I was passing the treemap? can anyone please give me some input.