answersLogoWhite

0

import java.util.Vector; suppose-:::: test t=new test(); /**this is how we add elements to vector*/ Vector v=new Vector(); v.addElements(t);

User Avatar

Wiki User

17y ago

What else can I help you with?

Continue Learning about Engineering

How do you call 2 or more objects in c plus plus?

It's not clear what you mean by "call 2 or more objects". Object's aren't "called", they are instantiated. Once instantiated you may "call" (invoke) the member methods associated with those objects, or invoke functions that operate upon those objects. To invoke the same member method on 2 or more objects, simply place those objects in a vector (by reference), then iterate over the vector: void f (std::vector<my_object*> objects) { for (auto foo : objects) foo->bar(); // invoke the bar method for each foo object in objects }


Can vector store string values in java programming?

A Vector can store any objects, so yes.


How do you implement vector?

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); } }


How many number of objects we can store in an ArrayList. Is there any limit?

No. there is actually no such limit in any of the collections in java. The arraylist and vector are the most commonly used collections and they take thousands of objects. I have personally used them with atleast a 100,000 thousand objects.


What does push back() do to a vector in c plus plus?

The vector's push_back() member inserts one or more new elements at the end -- the back -- of the vector. If there are insufficient unused elements available, the underlying array is reallocated with a larger reserve and the existing elements moved to the new allocation, after which the new elements are appended. All iterators into the vector are rendered invalid after a reallocation.

Related Questions

What does vector's member size() do?

The vector size() member returns the current size of the vector, in elements.


How do you call 2 or more objects in c plus plus?

It's not clear what you mean by "call 2 or more objects". Object's aren't "called", they are instantiated. Once instantiated you may "call" (invoke) the member methods associated with those objects, or invoke functions that operate upon those objects. To invoke the same member method on 2 or more objects, simply place those objects in a vector (by reference), then iterate over the vector: void f (std::vector<my_object*> objects) { for (auto foo : objects) foo->bar(); // invoke the bar method for each foo object in objects }


How do you display the elements in a vector to the user?

Generally vectors are displayed in parenthesis with the vector components separated by a comma. If there are vectors within another vector then brackets are used for the internal vector.


Is Asmospheric pressure a scalar or vector?

The answer is simple, define both a scalar: 1 variable, and a vector: 2 variables. Pressure is a force of space over time, therefore Asmospheric pressure is a vector since it applies both space and time using 2 variables.


What are vector objects?

Vector objects are graphics created using mathematical equations to define shapes and colors. They are resolution-independent, meaning they can be scaled to any size without losing quality. Common file formats for vector objects include SVG, AI, and EPS.


How are GIFs stored?

As raster images, so if you have vector objects and choose to save as gif, you will not be able to change vector objects next time you open image.


Can vector store string values in java programming?

A Vector can store any objects, so yes.


How are GIF images stored?

As raster images, so if you have vector objects and choose to save as gif, you will not be able to change vector objects next time you open image.


What is inventory displayer c plus plus?

// Inventory Displayer // Demonstrates constant references #include <iostream> #include <string> #include <vector> using namespace std; //parameter vec is a constant reference to a vector of strings void display(const vector<string>& vec); int main() { vector<string> inventory; inventory.push_back( "sword"); inventory.push_back( "armor"); inventory.push_back( "shield"); display(inventory); return 0; } //parameter vec is a constant reference to a vector of strings void display(const vector<string>& vec) { cout << "Your items:\n"; for (vector<string>::const_iterator iter = vec.begin(); iter != vec.end(); ++iter) { cout << *iter << endl; } }


The product of an objects mass and velocity is called its?

momentum (vector)


The measure of an objects speed and direction is the objects?

The measure of an object's speed and direction is the object's velocity. Velocity is a vector quantity that includes both the speed (magnitude) and the direction of motion of an object.


Which display device is suited for cad system a a crt with vector referesh monitor b crt with raster scan monitor c plasma panel display d led display?

a

Trending Questions
What kind of relationship can be concluded about the voltage difference across a resistor and the curent flowing through it? How much water pressure does a 1500 psi pressure washer need? Why the plot for output voltage from potentiometer as shaft position is a straight line? A passive threat to computer security is? How do you calculate the conductor size as per the current rating? How close can you build an addition to a septic system? The voltage in an electrical circuit is multiplied by itself each time it is reduced the voltage is 27125 of evil and it has been reduced three times right the voltage in exponential form? What program is the program that contains the language instructions or code to be converted? What did john gorrie use to make the first air conditioner? Which LAN topology is characterized by all devices being daisy-chained together with the devices at each end being connected to only 1 other device? What is the formulae for a 3 phase circuit to calculate the power? The device which disconnects the start winding in some split-phase motor circuits after a preset speed is obtained is the? Something you might need a ladder to clean? Does Ubuntu support Microsoft Visual C? What did Sarah Bagley invent? How would standards for creating webpages help internet searches? What subject to you use to become a mechanical engineer? What is the second glyphmaster code on trackers interface? Where did Daniel bernoulli go to college? Advantages of dynamic binding?