Thursday, June 02, 2005

Operators

Introduction

We need to be able to do something with the values. Operators is what you can do with the values.

The operators in Java are:

Operator =
'=' | '>' | '<' | '!' | '~' | '?' | ':' | '==' | '<=' | '>=' | '!=' | '&&' | '||' | '++' | '--' | '+' | '-' | '*' | '/' | '&' | '|' | '^' | '%' | '<<' | '>>' | '>>>' | '+=' | '-=' | '*=' | '/=' | '&=' | '|=' | '^=' | '%=' | '<<=' | '>>=' | '>>>=' ;

Program

package bloggingjava;

class Main {
    public static void main(String[] args) {
        System.out.println(6 * 9);
        System.out.println(42 % 9);
        System.out.println(true | false);
    }
}

Output

54
6
true

No comments: