Showing posts with label JAVA - Operators. Show all posts
Showing posts with label JAVA - Operators. Show all posts

Uses of JAVA Boolean Operators

class Main{
public static void main(String args[]){
    System.out.println(3<2);
    System.out.println(5>1);
    System.out.println(0==1);
    System.out.println(1!=2);
    System.out.println(2<=5);
    System.out.println(5>=2);
    }
}


The Output is Given Below:
false
true
false
true
true
true

Uses of Integer, double and Character in JAVA

class Main{
public static void main (String args[]){
    int i = 8;
    double d = 8.5;
    char c = 'A';
    System.out.println("Integer i = " + i);
     System.out.println("double d = " + d);
      System.out.println("Character c = " + c);       
    }
}


The Output is Given Below:
Integer i = 8
double d = 8.5
Character c = A