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 !!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.