Here are some of the lessons I summarized in the previous lesson and the code is most of the teacher's notes personally think is very good, but also a more classic content, sincere hope that these for those who want to learn some help!
Because the code is sub-module upload is very inconvenient. Also more, speak of is more clear! If you need to be able to leave your email in the comments I see will be sent to you for free! Thank you for this platform let us all progress together!! Remember that the programmer is selfless!!!
Also very welcome to my blog to watch the blog address: http://www.cnblogs.com/duscl/
/*1:list (Master) (1) List of sub-class features ArrayList: the underlying data structure is an array, query fast, and delete slow thread unsafe, high efficiency Vector: The underlying data structure is an array, query fast, and delete slow thread safety, low efficiency linkedlist: the underlying data structure is linked list, query slow, delete fast thread unsafe, high efficiency (2) Arrayli St A: There is no unique function to learn B: Case A:arraylist Store the string and traverse b:arraylist to store the custom object and Traverse (3) Vector A: Yes Unique feature a: add public void addelement (E obj)--Add () B: Get public E elementat (int index)--get () public enumeration<e> elements ()--iterator () B: Case A:vector Store the string and traverse B:vector to store the custom object and Traverse (4) LinkedList A: Has unique function A: add AddFirst () addlast () B: Delete Removefirst () Removelast () C: Get GetFirst () GetLast () B: Case A:linkedlist Store string and traverse B:lin Kedlist storing and traversing custom objects (5)Case: A: A repeating element that removes multiple strings in a collection if the contents of the string are the same, repeating element B: Removing duplicate elements of multiple custom objects in the collection if the member variable values of the custom object are the same, the repeating element C: Use LinkedList to simulate the collection class of a stack data structure and test it. You want to define a collection class, but you can use LinkedList to implement it internally. 2: Generics (mastering) (1) Generic overview is a special type of explicit type that is deferred until the object is created or the method is called. (2) Format: < data type > Note: This data type can only be a reference type. (3) Benefits: A: The operation period of the problem ahead of the compile period B: avoid the forced type conversion C: Optimized the program design, solve the yellow warning line problem, make the program more secure (4) Generic past life A: The origin of generics When an object type is an arbitrary type, it implies a transformation problem in the downward transition B: generic class C: Generic method D: Generic interface E: Generic advanced wildcard? ? Extends E? Super E (5) Where do we use it? is typically used in collections. 3: Enhanced for Loop (mastering) (1) is a (2) format for the For loop: for (the element's data type variable name: An array or an object of the collection collection) {Use this variable, which is actually an array or a collection of Elements. } (3) Benefits: simplifies the traversal of arrays and collections (4) The disadvantage enhancement for loop target cannot be null. It is recommended that you determine whether null before use. 4: Static Import (understanding) (1) can be imported into the method-level import (2) Format: Import static package name .... Class name. method name; (3) Note: A: The method must be static B: If multiple classes have the same name method, it is not good to distinguish, but alsoPrefix must be added. So generally we do not use static import, but must be able to understand. 5: Variable parameter (master) (1) If we are writing a method, the parameter number is ambiguous, we should define the variable parameter. (2) Format: Modifier Returns a value type method name (data type ... Variable) {} Note: A: The variable is actually an array name B: If a method has more than one parameter, and there are mutable arguments, the mutable parameter must be at the end (3) a method of the Arrays tool class Aslist () turns the array into a collection. Note: The length of this collection cannot be changed. 6: Practice (Mastering) A: Nested traversal of Set B: generates 10 random numbers between 1-20, requires random number cannot be duplicated C: keyboard input multiple data, end with 0, and output maximum value in console 7: To master the Code collection storage elements, add generics, and can use enhanced for traversal 。 *\
Java Basics (15) Set (ii)