Question & Additional Information
 
what is the Difference b/w "vector" and "array"?
Add to My IQ
 

 | 
Inappropriate
Answer Title
Answer
Vector and ArrayList are very similar. Both of them represent a 'growable array', where you access to the elements in it through an index.
ArrayList it's part of the Java Collection Framework, and has been added with version 1.2, while Vector it's an object that is present since the first version of the JDK. Vector, anyway, has been retrofitted to implement the List interface.
The main difference is that Vector it's a synchronized object, while ArrayList it's not.
While the iterator that are returned by both classes are fail-fast (they cleanly thrown a ConcurrentModificationException when the orignal object has been modified), the Enumeration returned by Vector are not.
Unless you have strong reason to use a Vector, the suggestion is to use the ArrayList
Question Tag Title
Tags
Question Asked At Title
Asked At
None
Question Job Title
Job Titles


Check out our newest job listings!

Post a Job! $49 for 60 days



Your Name:
Add your comment text
 
Related Questions
Related Questions
Flag this interview question as inappropriate Inappropriate
See Answer
the fifth element
Create Date
:
Tuesday, April 01, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
the fifth element
Create Date
:
Tuesday, April 01, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
no:brackets are used in array declarations not parentheses.
Create Date
:
Tuesday, April 01, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
Be the first one to answer the question Click here to answer
Create Date
:
Tuesday, April 01, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
Arrays can't be passed by values. Because , the array name is evaluated to be a pointer to the first element of the array. e.g. when we pass array x, its equivalent to &x[0] i.e. pointer to the first element. Its type is, therefore, int *, and a called function uses this pointer (passed as an argument) to indirectly access the elements of the array.
e.g . int main()
{
void function1(int A[],int n);

int x[10],i;
for(i=0;i<10;i++)
{ x[i] = 10;
 }
  function1(x,10);
}
void function1(int A[],int n)
{ ..../* some processing on the array */
}
In the above example,prototype shows the first formal parameter as an integer array without specifying the size. In C, this syntax is interpreted as a pointer variable; so array A is declared as an int * variable.
This is the unique feature of C is that array access is always indirect; thus making it particularly easy for a called function to indirectly access elements of an array and store or retrieve values.
Create Date
:
Sunday, March 16, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
A java.util.ArrayList has the following characteristics over an array: 1. Provides a resizable array implementation 2. Implements the java.util.List interface 3. Has a tuning parameter called initialCapacity which specifies the number of elements the ArrayList can hold before it has to be resized.
Create Date
:
Sunday, March 16, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
 
• More Related Questions: