Phase 1 Language Basics + Advanced _1-3-Java language senior _1- common API_1_ Section 4 ArrayList collection _13-ArrayList collection overview and basic use


Create a class



more than a angle brackets, capital letters E, What does it mean?
Angle brackets which is called generics. Unified type of storage, the type and wrote in angle brackets which we expressed in a letter placeholder.

How to create it constructor has three, the most common is no argument constructor

first master the add method inside of


generics can only be a reference type, not a basic type

must be written within angle brackets on the left and right can write you can not write

print out not an address



to write to this person ArrayList ArrayList has been specially






entered, the error will add digital


Ctrl + left mouse button you can also enter the source code inside ArrayList

 





 

 

Guess you like

Origin www.cnblogs.com/wangjunwei/p/11201495.html