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
Is there any difference between nested classes and inner classes?
How do you compare values in java?
What is unsigned char?
What is ‘has a’’ relationship in java?
Is sizeof a keyword in java programming?
Can we use a switch statement with strings?
What is finally block?
What is passing by reference in java?
How will you get the platform dependent values like line separator, path separator, etc., ?
Can a source file contain more than one class declaration?
What must a class do to implement an interface in java programming?
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
Write code to implement bubble sort in java?
How many digits can a float hold?
Is oracle java 11 free?