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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

When do we use synchronized blocks and advantages of using synchronized blocks?

895


Explain about doubly linked list

831


What does this () mean in java?

750


What is the transient keyword?

1309


What does @param args mean in java?

811


How do you convert an int to a double in java?

803


Explain restrictions for using anonymous inner classes?

834


Why is java architectural neutral?

844


When does an object becomes eligible for garbage collection in java?

813


What is difference between fileinputstream and filereader in java?

779


What is identifier in java?

780


Is stringwriter thread safe?

737


How to check if a list is sorted in java?

784


Can we sort array in java?

718


How to create a custom exception?

752