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

Are floats faster than doubles?

1062


What is this keyword in java?

1033


What is nan inf?

1080


What is the size of arraylist in java?

1028


What is the purpose of using bufferedinputstream and bufferedoutputstream classes?

1070


how we can create packages in java?

963


How does compareto method work?

962


Which methods are used during serialization and deserialization process?

989


What is an immutable class? How to create an immutable class?

1065


Can each java object keep track of all the threads that want to exclusively access it?

952


How can I right-justify a string?

1179


Is java programming easy?

994


What is * argv?

1233


What does jre stand for?

1063


What is += mean in java?

999