What is the 'instanceof' operator used for?
I learned that Java has the instanceof operator. Can you elaborate where it is used and what are its advantages?
Possible Duplicates:
What's the difference between | and || in Java?
Difference in & and &&
I was just wondering what the difference between & and && is?
A few days I wrote a condition for an if statement the …
What function does the ^ (caret) operator serve in Java?
When I try this:
int a = 5^n;
...it gives me:
for n = 5, returns 0
for n = 4, returns 1
for n = 6, returns 3
...so I guess it doesn't perform exponentiation. But what is it then?