Difference between array and arraylist.
Answer Posted / mohammad fazulullah
Array is the object and it stores the object of same type
Eg : Its stores complete integer types or string types
int[] IntArray = new int[3];
string[] StringArray = new StringArray[2];
Arraylist is the collection in which we can store the
objects of any data type.
Eg : Arraylist Arr = new Arraylist()
Arr.Add(13); // Integer Type
Arr.Add(10); // String Type
2 . Arrays has the Fixed Lenght where as the Arraylist
varies the leghth as the objects Added.
| Is This Answer Correct ? | 196 Yes | 32 No |
Post New Answer View All Answers
Can we rethrow the same exception from catch handler?
What are static initalizers in java ?
What is a ternary operator in java? What is an interface?
What does sizeof return?
Can we make a constructor final?
How are destructors defined in java?
Write a program to find the whether a number is an Armstrong number or not?
Explain the private protected method modifier?
whar are the draw backs of programming lang step by step in Clang and next in C++ and next and in Java nad in .Net
Can a method be static?
What are constructors in java?
Why is flag used in java?
Is array an object in java?
Is double bigger than float?
What is the preferred size of a component in java programming?