Java? ??? ???? ? ??? ?? ??? ???? Null ??? ??? ????. 1. ??? ???? ()? ???? ?? ?? ?? ??, optional.ofNullable ()? ???? ??? ??? ?? ??? ??????. 2. ispresent ()? ?? ?? ??? ???? get ()? ?? ?? ??? ??????. 3. Orelse () ? orelseget ()? ???? ???? ???? ?? ?? ? orelsethrow ()? ??? ????. 4. map (), flatmap () ? filter ()? ?? ?? ??? ???? ??? ??????. ?? ??? ?? ? ?? ??? ??? ???? ????? ????.
Java?? Optional
???? ???? ?? ?? ? ??? ?? ???? ?????. ????? ???? ?? ?? ??? ??? NullPointerException
??? ? ??????. ?? ??? ???? ???? ???? ??? ? ???? ??? ? ????.

?? ??? ????
Optional
??? ??? ? ?? ???? ??? ????.

-
Optional.of(value)
- ?? ??? ???? ?? ? ? ??? ??????. ????NullPointerException
? ?????. -
Optional.ofNullable(value)
- ?? ??? ? ?????. ??? ?? ?Optional
?????. -
Optional.empty()
- ? ????? ?????. "?? ??"? ?? ??? ????? ?? ?????.
?? ??:
?? <string> name = ?? ( "Alice"); ?? <string> maybename = ?? .ofNullable (getUserName ()); // null ? ? ???? ?? <string> noname = Optional.empty ();
??? ???? ??? ?? ?
Optional
??? ????? ?? ?? ???? ??? ???????. ??? ??? ????.

-
isPresent()
- ??? ?? ???true
?????. -
isEmpty()
- ??; ???? ???true
?????. -
get()
- ?? ????? ???? ????. ??? ???NoSuchElementException
????.
??? ??? ?? ??? ?? ?????.
if (OptionalName.ispresent ()) { System.out.println (?? ?? (??) ()); }
??? get()
?? ?? ??? ?? 100% ???? ?? ? ?????.
???? ?????
???? ???? ??? ? ?? ?? ??? ???? ???? ???? ???? ????.
-
orElse(defaultValue)
- ???? ?? ?? ???? ??? ??? ???? ?????. -
orElseGet(supplier)
- ????? ?? ??? ???? ???? ???? ?????. -
orElseThrow(exceptionSupplier)
- ?? ??? ??? ????.
? :
??? result = OptionalName.orelse ( "Guest"); ??? resultlazy = ?? ??. orelseget (() -> fetchDefaultName ()); ??? resultOrgrow = OptionalName.orelsetHrow (?? ???? ?? :: new);
??/?? ?/??? ??
? ??? ???? ???? ?? Optional
??? ??? ?? ? ? ????.
-
map(function)
- ????? ?? ?? ??? ???? ??? ??Optional
?? ?????. -
flatMap(function)
- ????? ???Optional
?? ? ??? ????? ? ? ??? ????. -
filter(predicate)
- ?? ??? ????? ?????. ??? ?? ?? ?Optional
?????.
?? ?? ???? ???? ???? ??? ? ? ????.
?? <???> ?? ?? = ?? ????? .filter (?? -> name.length ()> 3) .map (String :: toupperCase);
???? ??? if
? ?? ??? ????.
??? ????? ?????. ?? ??? ??? ?? ? ???? ????? ?? ?? ?? ?? ??? ??? ????? ?? ??? ??? ??? ???? ? ?? ?????. ???? ??? ???? ??? ?? ??????.
? ??? Java?? '??'???? ???? ??? ??????? ?? ?????. ??? ??? 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? ???? ?? ????.

staticmethodsininterfaceswereIntRectionSelffacesswithinteffaceswithinteffaceswithintintinjava8toallowutilityFunctionswithinterfaceitswithinteffaceswithinterfaceffaces

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

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

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

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

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

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