Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is wrong with this code?

 
Derek McDonald
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how would I be able to do that???
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Along the lines of
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic