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


Please Help Members By Posting Answers For Below Questions

What do you mean by pointer value and address?

811


What is the benefit of abstract class?

739


How to perform linear search in java?

772


How does a for loop work?

764


What are the types of collections in java?

812


Explain static nested classes ?

839


Why declare Main() method as a static in java ?

839


Why hashcode is used in java?

707


What is difference between module and function?

792


Can one thread block the other thread?

822


What is pangram in java?

783


How do you classify Dialog Box?

867


Can an interface have a constructor?

739


How to provide security in java

2035


What does nextint () do in java?

782