1. About arrays
Remember that the BinarySearch method returns the meaning of the numeric value of type int.
If The array contains multiple elements with the specified value, there is no guarantee which one would be found.
and returns 1 when the lookup number is less than any number in the array, and returns when the number of lookups is greater than any number in the array-(ARRAY.LENGTH+1)
SYSTEM.OUT.PRINTLN (Arrays * *)
If the parameter type is char[], then the output is a string of array elements, or a random string if it is an array of other types.
2.static Method Invocation
The following is very simple, but many experienced Java developers will be in the middle. Gossip less say, look at the code:
Nulltest mynulltest = null; System.out.println (Mynulltest.getint ());
When you see this code, many people will think that there will be nullpointerexception. Is it true? Look at the rest of the code again:
Class Nulltest {public static int getInt () { return 1;} }
Always remember that the use of class variables and class methods depends only on the type of reference. Even if the reference is null, it can still be called. From a good practice point of view, it is wise to use Nulltest.getint () instead of Mynulltest.getint (), but the ghost knows when to run into this code.
Java Sundry Tips