wood burning stoves 2.0*
The moose likes Java in General and the fly likes What is wrong with this code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "What is wrong with this code?" Watch "What is wrong with this code?" New topic
Author

What is wrong with this code?

Derek McDonald
Greenhorn

Joined: Sep 28, 2004
Posts: 3
Ok

I am not having the best of days and I don't want to see any more errors.

Compiler Output

Code Where Errors are Located


Class being stored in the vectors elements
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
The get() method of the Vector class returns an instance of class Object, you will need to cast this into an instance of Record before you call the getValue() method of the Record class.
Derek McDonald
Greenhorn

Joined: Sep 28, 2004
Posts: 3
how would I be able to do that???
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Along the lines of
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Is this a class assigment where you have to write your own sort routine? If so, then ignore the rest of my message. However, if you aren't required to write this routine, you should use Collections.sort() instead.

Layne


Java API Documentation
The Java Tutorial
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: What is wrong with this code?
 
Similar Threads
Unnecessary Synchronization
Alternatives to java.util.Properties?
Behaviour HashMap
Printing an Object without casting!
How to exclude empty values from a Vector