Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Vector class not found

 
Ajit Deshpande
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please consider this code:
class vector1 {
public static void main(String args[]) {
Vector a = new Vector();
int i = 10;
Integer Int = new Integer(i);
a.addElement(Int);

System.out.println(a.elementAt(0));
}
}
I think this should compile but my compiler is complaining that"Class Vector not found". I am using jdk1.2.1.
Could someone tell me if there is something wrong with the code or with the compiler.
Thanks
 
Angela Poynton
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you importing java.util.Vector ?
If not you'll need to, and make sure your classpath is pointing to JDK.
Hope this helps.
 
Adrian Ferreira
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this with corrections:
The change is the include of first line and changing the class name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic