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 / siri

remember.. there are 2 things involved.. capacity and size..
capacity represents how many max elements the list can
accomodate in it, size represents how many elements are
present currently in the list..the capacity is automatically
increased by certain amount (10, 20, 30..) based on the
current size once the size is equal to capacity..

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can singleton class be serialized?

511


Can we force garbage collector to run ?

568


Can we execute a program without main() method?

529


How many ways can an argument be passed to a subroutine and explain them?

570


How an object is serialized in java?

524






what is the difference between thread and runnable types? : Java thread

542


String class is defined under which package in java?

618


What is the main use of generics in java?

508


What is string data?

551


What is generic type?

569


Why hashset is used in java?

532


Can we extend immutable class?

529


Where and how can you use a private constructor?

532


How to check if linked list contains loop in java?

457


Can an anonymous class be declared as implementing an interface and extending a class in java programming?

644