Joined: Tue Nov 30, 2010 4:58 pm Posts: 2 Has thanked: 0 time Have thanks: 0 time
HI... i need some hints on Vector and Scalar Quantization coding ASAP
isuru
Question subject: Vector class
Posted: Thu Dec 02, 2010 5:56 pm
Joined: Thu Nov 18, 2010 11:56 am Posts: 49 Has thanked: 0 time Have thanks: 15 time
Vector class is in java.util package of java. Vector is dynamic array which can grow automatically according to the required need. Vector does not require any fix dimension like String array and int array. Vector contains many useful methods. To add element in Vector, we can use add() method of vector class. To add elements at fix position, we have to use add(index, object) method.
To get value from Vector, Vector provides get() method and Vector size() method. Size() method returns total number of elements in Vector.
Vector is synchronized, ArrayList is not...
Code:
import java.util.Vector;
public class VectorExample {
public static void main(String[] args) {
Vector<String> vc=new Vector<String>();
// <E> Element type of Vector e.g. String, Integer, Object ...