Function
System. The out. Println (f1. Apply (" ab "));
Function
System. The out. Println (f0. Apply (" aa "));
In the String class toUpperCase and matches are not static method, is what "String: : toUpperCase" can be normal use?
CodePudding user response:
: : it is a layer of syntactic sugar, with a static method it doesn't matter, it is very easy to understand
FunctionF1=String: : toUpperCase;
System. The out. Println (f1. Apply (" ab "));
The actual equivalent to
System. The out. Println (" ab ". ToLowerCase ());
But the second function
FunctionF0=String: : matches;
System. The out. Println (f0. Apply (" aa "));
What can you is equivalent to, not corresponding parameters
System. Out.println (" aa ". Matches (???? ));
It is clear that this way, you can't use: : to write
CodePudding user response:
Is: : only three on parameterless method? Where to find: the implementation of the logic (source)?