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

Explain inner classes ?

644


Why can't you declare a class as protected?

595


Which class should you use to obtain design information about an object in java programming?

644


Explain the features of java?

589


How are this() and super() used with constructors in java programming?

566






Difference between abstract and concrete class ?

579


What does string intern() method do?

585


What are the different collection views provided by maps?

563


What is functional interface in java?

509


How to sort numbers in java without array?

525


What is bitwise complement?

498


How to display all the prime numbers between 1 and 100

499


Does java arraylist maintain insertion order?

547


What is meant by flickering?

652


What are the different ways of creating thread?

568