• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help with measuring performance classes

 
Rebecca Plumb
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,I�m having some problems with my code.

here is the instruction:

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:






ERRORS:

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error on token "void", @ expected
Syntax error, insert "enum Identifier" to complete EnumHeader

at Vector.main(Vector.java:6)


Edit by mw: Added Code Tags.
[ February 06, 2008: Message edited by: marc weber ]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic