Performance Test: Implement a program that measures the performance of ArrayList, Vector, LinkedList by inserting 100,000 Strings and then deleting them one by one. Use a Calendar Object (p. 304) to measure the time in milliseconds. In addition to the screenshots give a table with the results. Bonus: Add sorting to the benchmark. What changes?
This is what I have so far for the Vector class:
Exception in thread "main" java.lang.Error: Unresolved compilation problems: Syntax error on token "void", @ expected Syntax error, insert "enum Identifier" to complete EnumHeader
Edit by mw: Added Code Tags. [ February 06, 2008: Message edited by: marc weber ]
First, I think you're supposed to use the Vector class in the API (java.util.Vector) instead of defining your own Vector class. Writing your own classes with the same name as classes in the API can lead to serious confusion later.
Second, your compilation error seems to be because you're trying to define a method inside the body of another method (getTime inside of main).
Third, there are other problems with braces. I think it would help to be more careful with your indentation and make sure these line up. (I've added Code Tags to your original post so that your indentation shows.)
(It looks like you're using an IDE that's confusing things. I suggest using a simple text editor.) [ February 06, 2008: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad: