Global Spa

1 ArrayList inherits abstractList and implements interfaces such as List, RandomAccess, Cloneable, Serializable, etc.

Default_CAPACITY; default initialized capacity of 10 elements

 

EMPTY_ELEMENTDATA : shared empty array instance for empty instances

DEFAULTCAPACITY_EMPTY_ELEMENTDATA :

elementData is the data of an object

 

size The actual size of the current list

 

Constructor: parameter, initialize the initial capacity of an arrayList

greater than 0, create an array of parameter size,

==0 copy empty_elementData to data

Otherwise throw an exception 

 

 

 

 

 

 

 

transient keyword:

https://www.cnblogs.com/lanxuezaipiao/p/3369962.html

An object that implements the Serilizable interface can be serialized, --- all properties and methods are serializable

There are actually many classes, some properties need to be serialized, and some are fields that do not need to be serialized, such as sensitive information. You can use the transient keyword to achieve

That is, the modified field only exists in the calling memory and will not be written to the disk for persistence

 The transient keyword can only modify variables, not methods and classes. Note that local variables cannot be modified by the transient keyword.

 

 

transient

 

 

 

 

 

 

 

 

 

 

 

 

 

DEFAULTCAPACITY_EMPTY_ELEMENTDATA

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324939534&siteId=291194637