+ 2
Find the output
Int a=5, b=6; b = a+b-(a=b) ; System.out.println("a: "+a+" b: "+b") ;
3 Answers
+ 1
a : 6 b : 5
+ 8
Error....
Btw It's a good trick ^^
Then...Let's share the other trick
With you trick often worked for int and double/float type
(I want to swap string and char too)
another trick is....
+ 8
a^=b;b^=a;a^=b;
But Not worked on String in java :(