if (a>b || a==2){

in if command it gives an error, sayin operator || can not be applied to a boolean.

I want to know how to use the and &&, or || operations in java..

Usually an ';' is added at the end of each command, such as this:



will work

will work

Thank you for repeating the solution I gave 17 hours before your post!

You are getting sarcastic !!!!