adspace


Difference between Array and vector?

Answer Posted / meghana

Array:
1)Size of array need to be declared in advance.
2)Once declared array can't grow in size.
3)Array can store primitive data types.like int,char,...
Vector:
1) No need to declare the size of vector. You may give its
size & you may not.
2) Vector can always grow in size if you start adding more
element to it than your declared size.
3) Vector can store only object references. Storing
primitive data types is not possible in case of vectors.

Is This Answer Correct ?    25 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between equals() and == in java?

1047


Differentiate between static and non-static methods in java.

1131


What is the difference between break and continue statements?

1131


What is a constructor overloading in java?

1131


What is parsing in java?

1046


What do you mean by an interface in java?

1107


What is java string pool?

1088


What is a classloader in java?

1096


What are the differences between heap and stack memory in java?

1151


Write a program to find the whether a number is an Armstrong number or not?

1107


Is minecraft 1.15 out?

1049


What is an object in java and how is it created?

1147


How to create a base64 decoder in java8?

1144


Realized?

2272


How to sort array in descending order in java?

999