??? OR? ??? XOR ???? ??? ??, ??, ??? ??? ?? ?????. ?? ????? ???? ^ ??? ???? ??? ????? ⊕? ???? XOR? ???, ??? ?? ? ????? ??? ??? ?? ?????? ?? ???? ?? ?????. ? ?????? XOR ???? ?? ??, ?? ? ?? ?? ??? ???????.
XOR?? ??????
XOR ???? ? ?? ?? ??? ???? ??? ??? true(1)? ???? ??(0) ??? ??? ?? ?? ?????. ??? ???? ??? ? ????.
Input A | Input B | A XOR B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
XOR ???? ?? "??? OR"??? ???. ???? ?? ? ??? true?? ? ? true? ?? ???? true? ???? ?????.
XOR? ?? ??
-
ID ??:
- ?? 0?? XOR?? ?? ???? ????.
- A ⊕ 0 = A
- ?? 0?? XOR?? ?? ???? ????.
-
?????:
- ? ??? XOR?? ?? 0? ???.
- A ⊕ A = 0
- ? ??? XOR?? ?? 0? ???.
-
???:
- XOR ??? ??? ???? ????.
- A ⊕ B = B ⊕ A
- XOR ??? ??? ???? ????.
-
???:
- XOR ??? ?? ???? ???? ? ????.
- (A ⊕ B) ⊕ C = A ⊕ (B ⊕ C)
- XOR ??? ?? ???? ???? ? ????.
-
??:
- ? ?? ?? ?? XOR? ?? ??? ??? ?? XOR?? ?? ?? ?????.
- (A ⊕ B) ⊕ B = A
- ? ?? ?? ?? XOR? ?? ??? ??? ?? XOR?? ?? ?? ?????.
XOR? ??
1. ??? ??? ???
??????? XOR? ?? ???? ?? ? ??? ?? ?? ??? ? ? ???? ???? ??? ??? ?? ????.
?:
public int findUnique(int[] nums) { int result = 0; for (int num : nums) { result ^= num; // XOR all elements } return result; // The unique number remains }
?? x ⊕ x = 0 ? ?? ??? ??? ???? ??? ?????.
2. ???? ?? ? ?? ???
XOR? ???? ?? ?? ?? ? ??? ?? ? ????.
?:
int a = 5, b = 10; a = a ^ b; b = a ^ b; a = a ^ b; System.out.println("a: " + a + ", b: " + b); // Output: a: 10, b: 5
??? ?? ??? ??? ????.
- a = a ^ b → a? b? XOR? a? ?????.
- b = a ^ b → ?? XORing?? a? b? ?????.
- a = a ^ b → ?? XORing?? b? a? ?????.
3. ?? ?? ? ???
XOR ???? ???? ???? ?? ?? ???? ?? ???? ?? ????? ?? ?????. XOR? ???(A ⊕ B) ⊕ B = A??? ??? ??? ? ???? ?????.
?:
// Simple XOR Encryption public String xorEncrypt(String message, char key) { char[] encrypted = new char[message.length()]; for (int i = 0; i < message.length(); i++) { encrypted[i] = (char) (message.charAt(i) ^ key); } return new String(encrypted); }
4. ??? ??
LeetCode? ?? ?????.
XOR? ???? ??? ??? ? ????.
s = "abcd" ? t = "abcde"? ?? 2?? ???? ?? ? ??? ????? ??? ???.
public char findTheDifference(String s, String t) { char result = 0; for (int i = 0; i < s.length(); i++) { result ^= s.charAt(i); } for (int i = 0; i < t.length(); i++) { result ^= t.charAt(i); } return result; }
? XOR? ??????
XOR? ?????? ???? ?? ???? ?????. ?? ?? ???? ????? ???, ?? ?? ?? ?? ??? ?? ?? ?? ???? ????. ??? ???? ?? ???? ??? ??? ???? ??? ??? ?????.
??
XOR ???? ???? ?? ???? ???? ??? ?????. ?? ??? ??????? ???? ?? ???? ???? ????? ????, ??? ??? ????, ??? ?? ?? ??? ?? ???? ?? ? ????. ????? ????? ???? ???? XOR? ????? ?? ???? ???? ? ? ?????.
? ??
- Java? XOR ???
? ??? ?? ??
- ????
- ???
- ?????
? ??? XOR ??? ??: ???? ??? ??? ?? ?????. ??? ??? 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. ?? ???? ??? ?? ?? ? ??? ?????? ?? ??? ??? ?? ?? ??? ????? ??? ??? ??? ??????? ?? ???? ??????.

staticmethodsininterfaceswereIntRectionSelffacesswithinteffaceswithinteffaceswithintintinjava8toallowutilityFunctionswithinterfaceitswithinteffaceswithinterfaceffaces

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

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

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

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

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