What function does the ^ (caret) operator serve in Java?
^
When I try this:
int a = 5^n;
...it gives me:
As others have said, it's bitwise XOR. If you want to raise a number to a given power, use Math.pow(a , b), where a is a number and b is the power.
a
b