Auto-Boxing: Integer i = 12; //=== integer i = new Integer (12);
Automatic unpacking: Integer i = 12; i + +//=== i.parseint () = 12; ++
If the box is not automatically disassembled only int i=i.intvalue ();
System.out.print (I+4);
Wrapper class and basic type Difference
----------------------
1. The wrapper class is an object, and the default value is null.
2. The basic data type of the digital type is 0.
3. The basic data type can be directly involved in the operation.
List: Lists, Interface ArrayList ()
Note: Arrays can only store basic data types, and collections can only store objects.
[] Array
---------------------
Length/Width Property
String
---------------------
Length ()//method.
Interface Collection
------------------------
Size ()//method
IsEmpty () //==null?
Judging set validity
Col! = null && col.isempty ()
Contains (object obj)//Determines whether the specified object is included
List //ordered, repeatable
Set//unordered, non-repeating
Note: The collection interface has two sub-interfaces: List (lists), set (set)
Map//key-value KV pair
TIPS:
List: Can hold repeating elements, element access is ordered.
Set: Can not hold duplicate elements, element access is unordered.
First judge whether the hashcode is the same, if different, can be stored, if the same, and then determine whether the same object and the Equals method is the same.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/82/14/wKiom1dK28PRut04AAGFbhUOJag952.png "title=" Picture 1.png "alt=" Wkiom1dk28prut04aagfbhuojag952.png "/>
instanceof
-----------------
operator to determine whether the variable is an object of the specified type.
Boolean b = obj instanceof String;
/**
* Create collection, store String[tom,tomas,tomslee]
* Storage integer[100,200,300]
* storage student{name,sex,age, standard Javabean}[tom,tomas,tomslee]
*
*/
Arraylist//Array list, packed in pairs, accessed by subscript value.
LinkedList//Chain list,
This article from "Yehomlab" blog, reproduced please contact the author!
"DAY10" Learning notes about the collection