?? ???? ?? ??? ??? ??? ? ?? ??? ?:
? 1 - ?? ?? ??? ?? ?? ?? ??
?? ?? ? ?:
MyValueSemLambda1 ????? {
?? getValue(); // ?? ???
}
MyValueImpl ???? MyValueSemLambda1? ?????{
??? ?? ?;
// value
??? ??????? ???
public MyValueImpl(?? ?) {
this.value = ?;
}
// getValue ??? ??
@?????
?? ?? getValue() {
? ?? ?????.
}
}
?? ??? MyValueSemLambda {
public static void main(String[] args) {
MyValueSemLambda1 myVal = new MyValueImpl(98.6); // ??? ? ??
System.out.println("?: " myVal.getValue()); // 98.6? ?????
}
}
?? ??:
MyValueCompare ????? {
?? getValue();
}
?? ??? MyValueComparacao {
public static void main(String[] args) {
// ??? ??? ?? ???? ?? ???
MyValueCompares myVal = () -> 98.6;
System.out.println("?: " myVal.getValue()); // 98.6? ?????
}
}
? 2 - LambdaDemo
// ???? ?????.
????? MyValue {
?? getValue();
}
// ? ?? ??? ?????.
????? MyParamValue {
double getValue(double v);
}
??? LambdaDemo {
?? ?? ?? ??(??? ??[])
{
MyValue myVal; // ????? ?? ??
// ??? ?? ???? ??? ?? ??????.
// myVal? ???? ????
? ?????.
// ?? ????
? ???? ???
// MyValue.
? getValue() ???
myVal = () -> 98.6; ??? ?? ???
//
?? ???? getValue()? ?????.
// ??? ??? ?? ???.
System.out.println("?? ?: " myVal.getValue());
// ?? ?????? ?? ???? ???? ?????
// MyParamValue ??????. ? ?? ????
? ?????.
// ??? ?????.
MyParamValue myPval = (n) -> 1.0/n; ?? ???
????? ??
// myPval ??? ?? getValue()? ?????.
System.out.println("4? ??? " myPval.getValue(4.0));
System.out.println("8? ??? " myPval.getValue(8.0));
// ?? ???? ??? ???? ????? ???
// ??? ?????? ??. ??? ?? ??? ???? ????.
// myVal = () -> "?"; // ??! ???? double? ???? ????!
// myPval = () -> ??.??(); // ??! ????? ?????!
}
}
??:
?? ?: 98.6
4? ??? 0.25
8? ??? 0.125
- ?? ???? ???? ?? ???? ????? ???.
???? ?? ?:
?? ?? ??? double? ?? ??? ?? ??? ? ????.
????? ??? ???? ????? ???? ??? ??? ? ????.
??? ?????? ???? ?? ?? ???? ?? ??? ? ????.
? 3 - ?? ???
??? ???: ? ?? ??? ? ?? ??? ?????? ?????.
?? ??: ? ?? ??? ? ?? ???? ??? ?????.
??? ??: ? ??? ???? ??? true? ?????.
- main()??? ?? ???? ???? ? ?? ?? ???? ?????.
// int?
? ????? ??? ??? ?????
// ?? ??? ?????.
????? NumericTest {
?? ???(int n, int m);
}
??? LambdaDemo2 {
?? ?? ?? ??(??? ??[])
{
// ? ?? ???? ??
// ?? ?????.
NumericTest isFactor = (n, d) -> (n % d) == 0;
if(isFactor.test(10, 2))
System.out.println("2? 10? ?????.");
if(!isFactor.test(10, 3))
System.out.println("3? 10? ??? ????.");
System.out.println();
// ? ?? ????
// ? ?? ??? ? ?? ???? ????.
NumericTest lessThan = (n, m) -> (n
if(lessThan.test(2, 10))
System.out.println("2? 10?? ????.");
if(!lessThan.test(10, 2))
System.out.println("10? 2?? ?? ????.");
System.out.println();
// ? ?? ????
// ??? ???? ?????.
NumericTest absEqual = (n, m) -> (n
if(absEqual.test(4, -4))
System.out.println("4? -4? ???? ????.");
if(!lessThan.test(4, -5))
System.out.println("4? -5? ???? ???? ????.");
System.out.println();
}
}
??:
2? 10? ?????
3? 10? ??? ????
2? 10?? ????
10? 2?? ?? ????
4? -4? ???? ????.
4? -5? ???? ?? ????.
???? ?? ???? ??? ??? ?????? ?? ??? ? ????.
??? ?? ??? ?? ?? ???? ???? ? ????.
??? ????? ??? ? ???? ?? ???? ?????.
? ???? ??? ?????? ??? ??? ???????.
NumericTest myTest;
myTest = (n, d) -> (n % d) == 0; //?? 1
if(myTest.test(10, 2))
System.out.println("2? 10? ?????.");
// ...
myTest = (n, m) -> (n
if(myTest.test(2, 10))
System.out.println("2? 10?? ????.");
//...
myTest = (n, m) -> (n
if(myTest.test(4, -4))
System.out.println("4? -4? ???? ????.");
// ...
????? ???
??? ?? ??(?: isFactor, lessThan, absEqual)? ???? ? ??? ?? ?? ???? ????? ???? ???? ? ??? ???.
?? ???? ??
?? ???? ?? ????? ?? ??? ??? ?? ?? ???? ??? ?????.
?: (n, d) -> (n % d) == 0.
?? ????? ??? ?? ??
??? ?????? ?? ????? ???? ???? ???? ??? ????.
???? ?? ??? ??? ??? ?? ???? ??? ? ????.
???? ??? ??? ?
??? ?????? ???? ? ???? ?? ???? ???? ??? ???? ? ?? ??? ?? ??? ???? ? ????.
// ? ???? ????? ??? ?????
????? StringTest {
?? ???(String aStr, String bStr);
}
??? LambdaDemo3 {
?? ?? ?? ??(??? ??[])
{
// ? ?? ???? ???? ????? ??? ?????
// ?? ??.
StringTest isIn = (a, b) -> a.indexOf(b) != -1;
String str = "??????";
System.out.println("??? ???: " str);
if(isIn.test(str, "is a"))
System.out.println("'?'?(?) ?????.");
? ?
System.out.println("'a'? ?? ? ????.");
if(isIn.test(str, "xyz"))
System.out.println("'xyz' ??");
? ?
System.out.println("'xyz'? ?? ? ????.");
}
}
??:
??? ???: ??????
'is a'? ???????.
'xyz'? ?? ? ????
StringTest ?? ?????
?? ?? ???? ?? ??? test(String aStr, String bStr)? ?????.
?? ????? ??
??? (a, b) -> a.indexOf(b) != -1? ???(b)? ?? ???(a)? ???? ??? ?????.
????? ?? ??
???? a? b? String ???? ????? indexOf? ?? String ???? ???? ??? ? ????.
????? "This is a test" ???? ????? "is a" ? "xyz" ?? ???? ???? ??? ???? ?? ?? ??? ?????.
? ??? ?? ?? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











?? ?? ?? ??? ??? ?? ??? ??, ? ? ?? ? ??? ?????. 1. ??? ?? ???? ?? ???? ???-????, ? ??? ??? ??? ? ????, Hashmap? ???-??? ?? ??? ??? ???? ????. 2. NULL ? ?? ???? HashMap? ??? NULL ?? ?? ? ?? ???? ?? HashTable? NULL ?? ?? ???? ??? NullPointerException? ?????. 3. ????? ??? ????? ?? ??? ?? ?? ? ????? HashTable? ? ??? ?? ?? ??? ????. ?? ConcurrenTashMap? ???? ?? ????.

Java? ?? ??? ??? ?? ??? ??? ?? ??? ??? ?? ??? ?? ?? ??? ???? ??? ?? ???? ?????. 1. ??? ???? ??? ?? ?? ? ???? ?? ??? ???? ?? ?? ??? ? ????. 2. ???? ?? ??? ???? ??? ?? ???? ?? ?? ??? ???????. 3. ?? ???? ?? ?? ?? ? ???? ???? ?? NULL ?? ??? ? ????. 4. ?? ???? ??? ?? ?? ? ??? ?????? ?? ??? ??? ?? ?? ??? ????? ??? ??? ??? ??????? ?? ???? ??????.

JIT ????? ??? ???, ??? ?? ? ???, ?? ?? ? ???? ? ? ?? ?? ??? ? ?? ??? ?? ??? ??????. 1. ??? ???? ?? ?? ??? ??? ?? ?? ???? ??? ?? ?????. 2. ??? ?? ? ??? ?? ?? ? ??? ???? ?? ?? ???; 3. ?? ??? ??? ?? ??? ???? ???? ???? ? ?? ?? ??? ?????. 4. ?? ??? ?? ??? ??? ???? ???? ?? ? ??? ???? ?? ??? ?????.

staticmethodsininterfaceswereIntRectionSelffacesswithinteffaceswithinteffaceswithintintinjava8toallowutilityFunctionswithinterfaceitswithinteffaceswithinterfaceffaces

???? ??? ??? Java?? ??? ?? ???? ??? ?? ? ? ??? ??? ???? ? ?????. ?? ???? ??? ??, ??? ?? ??? ?? ?? ??? ??? ????? ???? ????? ?????. ?? ??? ??? ??, ????? ? ??? ????, ?? ??? ??? ?????? ? ?? ? ?? ?????.

injava, thefinalkeywordpreventsavariable'svalue'svalueffrombeingchangedafterassignment, butitsbehaviordiffersforprimitivesandobjectreences.forprimitivevariables, asinfinalintmax_speed = 100; wherereassoncesanerror.forobjectref

??? ??? ?? ?? ??? ????? ? ???? ????? ???? ?? ???? ?? ???? ?????. ?? ??? ??? ????. ?? ?? ?? ??? ???? ???? ?? ?? ??? ??? ?? ?? ??? ??? ?????. ?? ??? ??? ????. ?? ??? ?? ??? ?? ?? ??? ?? ?? ??? ???? NewClass ()? ??? ?? ???? ????. ?? ??? ?? ??? ???? ?? ??? ?? ? ? ??? ?? ?? ??? ????? ????? ?????. ?? ??, ?? ?????? ?????, ??? ? ?? ????? ??? ?? ?????. ???? ?? ?? ??? ???? ?? ???? ?? ? ??? ???? ?? ??? ?? ?????? ?????. ???? ???? ??? ??, ?? ?? ? ?? ??? ????, ?? ?? ???? ?????.

??? ? ?? ??? ???? : ????? ?? ?. 1. int? ???? ???? ?? ?? ?? ? ??? ???? ?????. 2. ?? ? ???? (int) myDouble ??? ?? ?? ??? ?????. ?? ??? ??? ?? ??? ?? ??, ?? ?? ?? ???? ?? ??? ?? ???? ?? ?????. ???? ? ??? ??? ????. ?? ??? ??? ??? ??? ??? ?? ??? ??? ? ??? ?? ???? ??? ??? ??? ??? ? ??? ?? ??? ?? ??? ?? ?? ? ? ????. ?? ?? ??? ?? ??? ??? ??? ??? ? ??????.
