answersLogoWhite

0

How do you implement vector?

Updated: 12/19/2022
User Avatar

Wiki User

15y ago

Best Answer

import java.util.Vector;

public class VectorTest {

/**

* @param args

*/

public static void main(String[] args) {

//instantiating a vector

Vector vct = new Vector();

//Add objects to a vector

vct.add("One");

//getting values from the vector

String val = (String) vct.get(0);

//vector size

System.out.println("Vector size is: " + vct.size());

//removing elements from a vector

vct.remove(0);

}

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you implement vector?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can a vector be represented in terms of unit vector?

Yes, a vector can be represented in terms of a unit vector which is in the same direction as the vector. it will be the unit vector in the direction of the vector times the magnitude of the vector.


What is null vector?

NULL VECTOR::::null vector is avector of zero magnitude and arbitrary direction the sum of a vector and its negative vector is a null vector...


What is the angle between vector a and vector b when mode of vector a plus vector b is equal to mode of vector a minus vector b?

90 degrees


What is the sum of two vectors A.addition vector B.distance vector C.resultant vector D.displacement vector?

That is usually called the resultant vector.


Is vector A parallel vector B given that vector A is equal to the zero vector and vector B is equal to the zero vector?

The zero vector is both parallel and perpendicular to any other vector. V.0 = 0 means zero vector is perpendicular to V and Vx0 = 0 means zero vector is parallel to V.


120 meters northeast vector or scalar?

It is a displacement vector.


Vector that shows the combined effect of two or more vector?

Resultant vector or effective vector


What is relationship between vector space and vector subspace?

Vector spaces can be formed of vector subspaces.


What is different between negative vector and null vector?

A null vector has no magnitude, a negative vector does have a magnitude but it is in the direction opposite to that of the reference vector.


What is a scalar times a vector?

A scalar times a vector is a vector.


Why is Vector resolution the opposite of vector addition?

Vector addition derives a new vector from two or more vectors, and vector resolution is breaking a vector down into its two or more components.


What is the physical significance of null vectors?

Zero vector or null vector is a vector which has zero magnitude and an arbitrary direction. It is represented by . If a vector is multiplied by zero, the result is a zero vector. It is important to note that we cannot take the above result to be a number, the result has to be a vector and here lies the importance of the zero or null vector. The physical meaning of can be understood from the following examples. The position vector of the origin of the coordinate axes is a zero vector. The displacement of a stationary particle from time t to time tl is zero. The displacement of a ball thrown up and received back by the thrower is a zero vector. The velocity vector of a stationary body is a zero vector. The acceleration vector of a body in uniform motion is a zero vector. When a zero vector is added to another vector , the result is the vector only. Similarly, when a zero vector is subtracted from a vector , the result is the vector . When a zero vector is multiplied by a non-zero scalar, the result is a zero vector.