Through the SCJP, the experience and experience will be written here.

xiaoxiao2021-03-06  39

Experience: 1. About the bangs: -5% -2 remaining symbols look at the number of arithmeters on the left, so the remainder is negative. Then because 5% 2 is 1, the result is: -1 -5 / -2 = 2, so: -2 * 2 -1 = -5 Simpler: -5 / 2 = -2, -5% 2 = -1 The above also illustrates the symbols about the wholeness of the whole! Get rid of it, be sure to see the topic 2. About the inherited access. Whose access is low in protected, Friendly? Because: protected by the function, you can call in the package, you can also call outside the package, and the Friendly function can only be called inside the package, so protected has a larger access range, that is, its permission is high. Friendly's permissions are low. So sorting: public> protected> friently> private3. For the interface, the method in which no modifier default is PUBLIC. So the default inherited access can only be public. Can't be Friendly4. About the reference delivery in the function parameters, if there is an object's reference. Then all follow the principles. Transfer process, will be delivered. The reference to the reference object can be changed during reference, but if this function is, the reference will continue to point to the original object. That is, in the function transfer, the delivery of the guide is a transmission value, the reference pointing to the object does not change before and after the function call 5. A NULL reference can also be directly called the class Static member without any errors. 6.in order for the Java Collections to work properly (and everything else in Java), the equals () and hashCode () methods must be compatible. Here, compatible means that if equals () reports that two instances are the same, then the hashCode ( ) of Both Instances Must Be The Same Value. 7. Static members should access in static methods, but can also be used with object names. Static variable names 8. Displacement operators: int A = -1; a = a >> > x; if it is integer, it is displaced according to X MOD 32. If x = 32 is not shifted. If x = 1 is the same as the shift result of X = 31. 9. Note:% (MODULUS) can be used on the floating point number. The balance is not stopped until the result is less than the division, the result is the remaining number 10. When the variable is accessed, the reference is used. When the function is accessed, it is an object. It is especially suitable for references for parental classes, subjects of subclasses. This reference is when using the variable, it must be a parent class. If you don't report an error 11.TRY can also not with catch, with finally, it will be 12. If there is a repeating element in Hashmap, it is called by Key. The last 13. About the subclass function throws an abnormal problem.

Theorem ---------- Principles --------- Used for the parent class, you should not be modified for the subclass to extend theorem: Theorem 1: If the child After the class function throws an exception, after the parent class overrides the function, it can throw an exception or no throwing anomaly. 2: If the subclass function does not throw an exception, the parent class overwrites the function, it must not throw an exception. About Assertion discussion: AssertionError is the subclass of Error, in a way's throw statement, we do not have to force it. Since Error and its subclasses do not have to force throw, then we can throw it in our subclasses regardless of their parent methods. This is like RuntimeException. 14. About threads. The call to the thread is not time. You don't know when operating the system to call and execute a thread, so it is uncertain in the thread to modify whether the value is really changed. Because the ghost knows if the thread is executed? 15. The variables in the method will not initialize. 16. BYTE can have a negative number, so its range is: -128 to 12717. Implement the class runnable class, must implement the method Run, Run is an 18 that does not have any parameters. When the array is passed to the function, if the value of the array is changed, the value of the function call end array is the value of the value of the function call. . 19.wait (), notify () is an instance method of Object (), run (), and toString is the instance method of Thread. Sleep () is Thread's static method 20. == This conditional operator is high than the priority of assignment =, so ... 21.Collection, SET, SORTEDSET, LIST, MAP AND SORTEDMAP. THE MOST basic interface is Collection Three interfaces extend Collection:. Set, List, and SortedSet The other two collection interfaces, Map and SortedMap, do not extend Collection, as they represent mappings rather than true collections.22.All the variables in an interface are. Implicitly static and final. Any Methods in An Inn Interface Have No Body (Implicitly Abstract), SO May Not Access Any Type Of Variable.23. Concept of Down Transformation: Class Base {} Class Sub Extends Base {}

Public class myclass {public static void main (string argv []) {base b = new base (); sub s = (sub) b;}} here sub b = (sub) b; there is no problem in the compile period, but execution It will definitely report an error. Because B itself is a base class object. So the downward transformation will have problems. But modify base b = new base (); is Base B = New Sub (); there is no problem. Because the B itself is a SUB object 24.Object's equal method, just the result of the completed identical object in two references. Otherwise, it is false, this, StringBuffer is exactly the same. 25.java -dorg.xml.sax.driver = com.nc.xml.saxdriver SurveyReader (Note that the -d should not have space.) 26. If the parent class does not have the default constructor, the subclass constructor must be required. Explicit calls the parent class constructor, otherwise the compilation will not pass. Also, if all the constructor of the subclass is private, the class cannot be inherited 27. Please note that the 8-based number is not 8. 28. Principles regard hashCode and equal to (1) Whenever two objects are equal according to the equals (Object o) method, then calling the hashCode method on each of the two objects must produce the same integer result. (2) Whenever it is invoked On the Same Object More Than Once During An Execution Of A Java Application, The Hashcode Method Must Consistently Return THE SAME INTEGER.29.MAY Not, Imposion 30. When the method is called in the constructor, it is also dynamic. If the parent class constructor calls a method, the subclass also overwrites this method, and when generating a sub-object, it is inevitably calling the subcatenium because the parent class constructor is called. Note that as long as the method is called, it must be dynamic type identification 31. About Assertassert Expression1: Expression2; If Expression1 is false, throw an exception, the content is: Expression2 is true, continue executing the program, does not execute Expression2. If expression1 (which must be a boolean expression) is evaluated to true, the expression2 will not be evaluated32 If two objects are equal, the hash codes returned by them are same;. But converse is NOT true If two objects are not equal,. THEIR HASH CODES COULD STILL Be Same.33. When you make any mathematical operation or bit operation than Int, the result is promoted to int, the resulting result It will also be int models. So if you want to assign the result to a smaller gender, you have to perform a transition action.

转载请注明原文地址:https://www.9cbs.com/read-69354.html

New Post(0)