Object: Root Class
Tostring,equals,hashcode
Package Type: 8, Integer,character
XXX parsexxx (), Auto boxing (new Xxx ()) and automatic unpacking (intvalue ())
String class:
String:final class, non-changing unicode, Returning a new string object
The stringbuffer,stringbuilder:final class, which can change the unicode, returns the original buffer of the string object
Math Class:
Math: Static
Constants and methods
Collection:
Store different types of objects, variable length
Arrays: storing data of the same type, fixed length
Collection: storing unordered and repeatable elements
---List: Elements repeat, ordered
---ArrayList
---linkedlist
---Set: element Repetition is not allowed, unordered
---HashSet
---SortedSet
---TreeSet
Generics: jdk1.5, which can be considered a security mechanism,
representation:< element type > Once a generic is used, it is equivalent to adding a constraint to the collection,
The collection can only store the type of elements specified by the generic type
The generic type parameter does not support polymorphism
?: wildcard character, can represent any type
? Extends E: Receives the subtype of type E and its e----upper limit
? Super E: Receives the parent type of type E and its e----lower bound
HashSet: the underlying data structure is: hash algorithm.
Each object to be stored computes the hash code value (the hashcode method), and if the hash value is different, it is deposited into the Collection.
If the hash value is the same, the second check is made by the equals method, and the comparison is whether the same object
TreeSet: the underlying data structure Is: two fork tree, which sorts the elements in natural order
When storing a custom object, you must implement the comparable interface and implement the CompareTo method of the interface
Based on the return value of the method, the natural order is sorted,
The return value is a positive integer, a negative integer, 0, if 0 means the same element.
ArrayList: the underlying data structure is: array
Element continuous, Find and modify fast, Delete and add slow
Linkedlist: the data structure of the city Is: doubly linked list
Elements can be discontinuous, find and modify slowly, Add and delete fast
Iterators:
---retrieve the elements of the collection,---called an iteration
Iterator Iterator ()
Listiterator Listiterator ()
Java Handy notes eight set generics