All night harvest ...............

xiaoxiao2021-03-06  94

03:34:37

This is the add method in ArrayList, how will it be processed when you do not add an object to the ArrayList container?

£ 飘 £ 03:38:37

Is it java5.0?

£ £ 03:38:49

look in

That check array is loaded under MINCAPACITY> Oldcapacity

03:38:28

If you can't install, you will give ElementData to a new Object OldData [] = ElementData;

03:38:52

Then point ElementData points to a new array, this array is larger than the original

03:39:07

ElementData = New Object [newcapacity];

03:39:44

Newcapacity's size is the int new capacity = (Oldcapacity * 3) / 2 1 in this way; it is 1.5 times plus one

Sad Yoti 03:41:04

Then assure the original value to the new array! This will complete the conversion

£ £ 03:47:17

Good guy calls me to see a program

03:45:18

? ? ?

£ £ 03:49:50

Looking at a last night, there is another night.

Http://www.cnjbb.org/thread.jsp?boardid=3&threadid=42766

£ £ 03:50:04

2

03:46:56

Halo ~

£ £ £ 03:52:29

Is there a connection between 2 programs just sent?

Sad Yoti 03:49:32

Why do you say that arraylist doesn't use i, I said that he is self-incremental, then I am on QQ is why he will automatically add array capacity.

03:49:45

You know the general array, when we initialize, it is specified in size, and then only put it down.

03:49:58

And why can arraylist do not specify a size, put any more objects inside?

03:50:04

The above is the explanation of the program.

转载请注明原文地址:https://www.9cbs.com/read-106744.html

New Post(0)