T
Taria
Hello all,
I just discovered the Vector class today and am having trouble
accessing the variable elementCount. First I received a protected
package error so I adjusted for this by creating another class that
extends Vector..
When I try to compile below, the error I'm encountering is:
"MyProg.java:9: warning: [serial] serializable class myVector has no
definition of serialVersionUID
public class myVector extends Vector"
import java.util.*;
public class MyProg1 {
public static void main(String[] args) {
Vector testVector = new Vector();
testVector.addElement(new String ("I am a string"));
//System.out.println ( testVector.elementCount ); //protected
package error, cannot use
}
}
public class myVector extends Vector{
public void myVector(){
Vector v = new Vector();
System.out.println (this.elementCount);
}
}
Any advice is appreaciated,
-t
I just discovered the Vector class today and am having trouble
accessing the variable elementCount. First I received a protected
package error so I adjusted for this by creating another class that
extends Vector..
When I try to compile below, the error I'm encountering is:
"MyProg.java:9: warning: [serial] serializable class myVector has no
definition of serialVersionUID
public class myVector extends Vector"
import java.util.*;
public class MyProg1 {
public static void main(String[] args) {
Vector testVector = new Vector();
testVector.addElement(new String ("I am a string"));
//System.out.println ( testVector.elementCount ); //protected
package error, cannot use
}
}
public class myVector extends Vector{
public void myVector(){
Vector v = new Vector();
System.out.println (this.elementCount);
}
}
Any advice is appreaciated,
-t