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
What is difference between classpath and path variables in java?
What is lastindexof in java?
What is bubble sorting in java?
What is the purpose of tostring() method in java?
how is final different from finally and finalize in java?
Can we define private and protected modifiers for variables in interfaces?
What is serial version uid and its importance in java?
Difference between comparator and comparable in java?
How to write custom exception in java?
Why Java is not pure Object Oriented language?
What is an accessor?
Is boolean a data type in java?
how to write a program for sending mails between client and server
Define an abstract class with reference to java.
Which is better singleton or static class?