Comparison Operators in Java




This video tutorial explains the comparison operators available in java programming language.

You will learn what are the comparison operators available in java, how to user them, what result they are gonna produce, on  which type of operand they are gonna work in detail with example.


Source code for this video tutorial


package learningJava;

public class Fish {
 public static void main(String[] args) {
  boolean result;
  int num1 = 100,num2 = 10;
  
  result = num1 > num2;
  System.out.println(result);
  
  System.out.println(num1 < num2);
  System.out.println(num1 <= num2);
  System.out.println(num1 >= num2);
  System.out.println(num1 == num2);
  System.out.println(num1 != num2);
 
 }