Well, consider what happens if a nd b are replaced with methods a() and b() (both of which return booleans). If I write
and if a() returns false - well, obviously the value of c will be false, regardless of what b() returns. However - method b() may have a side effect. As a programmer, I may want to ensure that method b() executes, and has its side effect, regardless of the fact that the value of c may not depend on b() at all. Or, maybe I don't want b() to execute unless it really effectus things. Either one of these situations is possible, really, depending on what the programmer is trying to do. So Java offers a choice - if you want short-circuiting, use && and ||; if you don't want short-circuiting, use & and |. In my experience, there's rarely much reason not to use short circuiting - which is why && and || are much more common (in my experience) than & and |. However the latter are still available as an option, for the (relatively rare) cases where this is what the programmer desires.
i know that they are not shortcut operators. but waht is the logic behind it? the logic behind && being a shortcut operator is, that when given (A && B) and A is false, then doesn't metter what will be B and it will always be false. thats why we don't even evaluate B.
in (A & B), if A is false, it's also doesn't metter what B will be.
what is the logic then not to make it also as a shortcut operator and not to save some operations?