-----------Android Training, Java training, Java Learning Technology blog, look forward to communicating with you. ------------
I. Reflection of an array:
A the array with the same dimension and element type belongs to the same type, which has the same class instance object.
b the Getsuperclass () method that represents the class instance object of an array returns the class that corresponds to the object class.
c The one-dimensional array of basic types can be used as object type, not as a object[] type, a one-dimensional array of primitive types that can be used as object types and can be used as object[] types
Two. Comparison and hashcode analysis of Arraylist-hashset:
(a) Overrides of equals () and Hashcode () methods
b When an object is stored in the HashSet collection, it is not possible to modify those fields in the object that participate in the computed hash, otherwise the modified hash value of the object is different from the hash value originally stored in the HashSet collection, in which case Even if the Contains method retrieves an object in HashSet using the argument used by the current reference of the object, the result of the object cannot be found, which also results in a memory leak because the current object cannot be deleted individually from the HashSet collection.
Three. The role of reflection: the realization of the framework function
(a) core issues to be addressed in the framework and framework
I do the house to sell to the user to live, by the user to install doors and windows and air-conditioning, I do the house is the framework, users need to use my frame, the door and window into the framework I provided, the framework and tool classes are different, the tool class is called by the user's class, and the framework is to invoke the user-provided class
(b) Core issues to be addressed by the framework
I. I write the framework how to call to the user after the class written
ii. because it is not possible to know the class to be invoked when writing a program, it is not possible to directly new an instance object of a class, but to do so with reflection.