What function does the ^ (caret) operator serve in Java?
^
When I try this:
int a = 5^n;
...it gives me:
That is because you are using the xor operator.
In java, or just about any other language, ^ is bitwise xor, so of course,
10 ^ 1 = 11. more info about bitwise operators
It's interesting how Java and C# don't have a power operator.