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 fundamental datatype?

1052


What do you know about the garbate collector?

1083


Why java is object oriented?

1082


What is the difference between comparison done by equals method and == operator?

1063


What are java packages? What's the significance of packages?

1405


Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?

1075


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

1105


Write a method that will remove given character from the string?

1083


What is the difference between a synchronized method and a synchronized block?

1122


What is the default size of set in java?

1018


What is the right data type to represent a price in java?

1020


How do constructors use this() and super()?

1186


What is difference between length and length() method in java ?

1052


What is difference between == and === in js?

1061


Can long be null in java?

1082