Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is an array and a vector? How they different from each
other?

Answers were Sorted based on User's Feedback



What is an array and a vector? How they different from each other?..

Answer / ranganathkini

An array represents a contiguous block of memory where
objects are stored and accessed via a 0-based index value.
Arrays are usually fixed size once they are created.

A java.util.Vector is an implementation of a resizable
array. It has similar functionality as an array but also
gives the advantage of resizability when u try to add
elements to it exceeding its initial size.

The problem is that Vectors are synchronized which is not
necessary for many purposes and this may bring down
performance. Hence the use of ArrayList over Vecotor is
recommended. An ArrayList provides the same functionality of
a Vector, except tat it is not synchronized.

Is This Answer Correct ?    1 Yes 0 No

What is an array and a vector? How they different from each other?..

Answer / prabir kumar

arrays have elements of same datatypes, but vector can have
elements of any types.

Is This Answer Correct ?    1 Yes 0 No

What is an array and a vector? How they different from each other?..

Answer / suhas

1)Array is a collection framework class.

Vector is a legacy class.

2)Array is not synchronised by default

Vector is Synchronised by default

Is This Answer Correct ?    1 Yes 0 No

What is an array and a vector? How they different from each other?..

Answer / manjusinga

Arrays group values and permit fast access by numeric
index. Vectors are a variant of arrays that also permit
fast access by numeric index.

They differ from each other in this way.
vector can grow and shrink dynamically where as array
cannot.

vectors can be synchronised where as arrays cannot be.

vecotrs are implemented from list interface where as arrays
are primitive datatypes.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can we execute a program without main?

0 Answers  


wat is final...? wat is finally...? wat is finalize....? difference between " final and finally and finalize "...?

2 Answers  


What is loop in java?

0 Answers  


What is JAVA? Why it is platform independent?

10 Answers   NIIT,


I have 2 objects inside one object(vector). how can i serialize one of them. I dont want to serialize the second one

3 Answers   ABC, L&T,


when,where and how to use abstract class and interface

2 Answers  


What is the memory leak in java?

0 Answers  


What causes memory leaks in java?

0 Answers  


Explain how hashmap works?

0 Answers  


What is meant by class and object in java?

0 Answers  


What is garbage collection? Can it be forced to run?

0 Answers   Global Logic,


What is the difference between static and global variables and also define what are volatile variables?

0 Answers   Flextronics, Hexaware,


Categories