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 is Enum in Java?

904


What is exception in java?

758


Is string is a data type?

751


What does microservices mean?

711


What are functions in java?

716


What are autoboxing and unboxing? When does it occur?

710


What is a parameter in java?

746


Is alive method in java?

727


Why main function is static?

908


What is the right data type to represent a price in java?

761


What is the importance of main method in Java?

808


What are the two ways to create a thread?

751


Where can i get Latest SUN Certification Dumps and what are the Sun Certification Codes that are available, Im new to JAVA, so please gimme info as i need to write J2EE - Core Java Certification

1631


Name some classes present in java.util.regex package.

811


Explain the difference between hashmap and hashtable in java?

718