if arraylist size is increased from initial size what is
the size of arraylist...suppose initial is 100 , if i add
101 element what is the size...
Answer Posted / satish
from the Java Source code of ensureCapacity() API,
int newCapacity = (oldCapacity * 3)/2 + 1;
So, (100 *3)/2 + 1 will be the answer.
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
Explain jvm, jre, and jdk?
What is threaded programming and when is it used? : Java thread
What is variable in java?
What is the purpose of declaring a variable as final?
What is an immutable object?
What is defined as false sharing in the context of multithreading?
When do you get classcastexception?
What is the difference between array and array list in java?
Why 1 is not a prime number?
When should the method invokelater() be used?
What is the multi-catch block in java?
What is bubble sort in java?
What is the significance of java packages?
Differentiate between nested and inner class in java.
How an object is serialized in java?