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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default execution method in java?

1139


What is the main use of java?

1102


What are the advantages of inner classes?

960


What is pre increment and post increment in java?

951


Is java a super set of javascript?

1051


What does sizeof return?

940


Why java is platform independent? Explain.

963


What is better - 'bit-shift a value' or 'multiply by 2'?

1124


Which class cannot be a subclass in java?

961


What is a map in java?

939


What is the difference between the direct buffer and non-direct buffer in java?

987


Which collection is sorted in java?

985


Can we have 2 main methods in java class?

960


Explain different types of thread priorities ?

1044


Is a string literal?

1013