??? Java ??????? ??? ??? ?? ????? ??? ???. Java?? ??? ??? ??? ?? ?? ? ?? ?? ?? ???? ???? ?????. Comparable ? Comparator. ??? ????, ? ? ??? ??? ?? ????. ??? ??? ???? ??? ?????. ???? ????? ??? ? ???? ???? ???? ??? ?????.
?? ??: ????
Comparable ?????? ?????. ? ?? ????? ???? ?? ???. Comparable? ???? "? ??? ???? ??? ?? ????."?? ??? ????. ?, Comparable? ???? ???? ??? GPS ??? ?? ?? ?? ??? ???? ????. ?? ??? ??? ????.
- ??? ??: ?? ??? ? ??????. ?? ?? ??? Person ????? ????? ????? ?????, ??? ???? ?? ? ???? ? ??? ???? ???. ??? ?? ?? ???? “????? ???, ?? ?? '???' ?????. ?????!”
- ?? ??: CompareTo() ???? ????? ?? ??? ?????. ?? ?? “??? ?? ?? ?? ?????. ??? ??? ?????, ??, ??????!”
?? ??? ?? ???????
public class Person implements Comparable<Person> { private String name; private int age; *// Implement compareTo* public int compareTo(Person other) { return Integer.compare(this.age, other.age); }
? ??:
- ?????. ???? CompareTo()? ??? ?? ??? ?????.
- ?? ?? ??? ?? ??? ?? ???? ?? ?? ?????.
? ??:
- ??? ??! ?? ??? ??? ?? ? ????. ?? ??(?: ??)?? ???? ?????? ????!
???: ??? ?? ?
?? ???? ?? ??? ???? ??? Comparator? ?????. ???? ??? ???? ???? ???????. ??? ??? ?? ?? ????. ?? ??? ??? ?? ???? ?? ????. Comparator? ???? ??? ??? ???? ??? ??? ?? ??? ? ????!
- ??? ?? ??: ??, ??, ? ? ??? ?? ??? ?? ??? ???? ?? ? ????! ??? ?? ??? ? ?? ??? ?? ?? ????. ??? ????? ????????? ??! ??? ???? ????????? ???!
public class Person { private String name; private int age; *// Comparator for sorting by name* public static Comparator<Person> nameComparator = new Comparator<Person>() { public int compare(Person p1, Person p2) { return p1.name.compareTo(p2.name); } }; *// Comparator for sorting by age* public static Comparator<Person> ageComparator = new Comparator<Person>() { public int compare(Person p1, Person p2) { return Integer.compare(p1.age, p2.age); } }; }
? ??:
?? ?????. ??? ?? ??? ?? ??? ????. ??, ??, ? ? ?? ??? ???? ?????!
?? ??? ?? ??? ????. ??? ???? ?? ??? ?? ???? ??? ???? ?????? ???? ???? ??????.
? ??:
- Comparable?? ?? ? ?????. ??? ?? ???? ??? ???? ???? ???.
?????: ?? vs ??
? ? ??? ???? ???? ??? ???????.
?? ?? ? ?? ?
- ?? ?? ?? ??? ??? ?????(????). ??? ?? ??(??? ??) **?? ?? ??? ?? ?? ??? ??(?? ??? ?????).
- ??? ?? ?? ?? ??? ?? ??
- ?? ??? ?? ?? ??? ? ?????/?? ??? ? ??
- ?? ???? ????????? ?, ??? ??? ?????. ???, ???? ??? ?????
?? ??? ?????? ?
?????! ?
???? ????? ?? ??? ?? ? ? ?? ?? ??? ??? ??? ??? ??? Comparable? ?????. ??? ????? ???? ???? ? ????.
??? ?? ?? ??? ? ? ?????(?? ?? ??? ????? ??) ?? ??? ??? ???? ??? ?? ?? ?? Comparator? ???? ??? ?????. ?? ????? ???? ?? ????. ? ?? ??? ? ??????!
??? ???
??? ???! Comparable? ?? ??? ?? ???? ??, Comparator? ??? ??? ? ??? ? ?? ??? ??? ??????. ???? ???? ???? ?? ??? ???? ?? ??? ??? ?? ??? ???.
?? ?? ???? Java ??? ??? ? ?? ?? ?????. ?
? ??? ??? ??? 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
