Deprecated: Creation of dynamic property Kirki_Toolkit::$modules is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/kirki.php on line 67

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Textarea::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Toggle::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Custom::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Custom::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio_Image::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Multicheck::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Number::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Text::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio_Image::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Multicheck::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio_Image::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Custom::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Custom::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Warning: Cannot modify header information - headers already sent by (output started at /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php:291) in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-includes/feed-rss2.php on line 8
Relational Operators in Java Archives - OctopusCodes https://octopuscodes.com/tag/relational-operators-in-java/ Tue, 24 Jan 2023 02:33:11 +0000 en-US hourly 1 https://wordpress.org/?v=6.9 https://octopuscodes.com/wp-content/uploads/2022/12/cropped-logo-80x80-1-32x32.png Relational Operators in Java Archives - OctopusCodes https://octopuscodes.com/tag/relational-operators-in-java/ 32 32 Relational Operators in Java https://octopuscodes.com/java/java-tutorial/basic-java/relational-operators-in-java/ Tue, 24 Jan 2023 02:11:23 +0000 https://octopuscodes.com/?p=1093 In Java, relational operators are used to check the relationship between two operands. Operator Description == Is Equal To != Not Equal To > Greater Than >= Greater Than or …

The post Relational Operators in Java appeared first on OctopusCodes.

]]>
In Java, relational operators are used to check the relationship between two operands.

OperatorDescription
==Is Equal To
!=Not Equal To
>Greater Than
>=Greater Than or Equal To
<Less Than
<=Less Than or Equal To

1. “Equal to” Operator(==)

This operator is used to check whether the two given operands are equal or not. The operator returns true if the operand at the left-hand side is equal to the right-hand side, else false.

package octopuscodes.com.demo;

public class Demo {

	public static void main(String[] args) {
		int a = 10, b = 5;
		boolean result1 = a == b;
		System.out.println("result 1: " + result1);

		int c = 7, d = 7;
		boolean result2 = c == d;
		System.out.println("result 2: " + result2);
	}

}
result 1: false
result 2: true
 

2. “Not Equal to” Operator(!=)

This operator is used to check whether the two given operands are equal or not. It returns true if the operand at the left-hand side is not equal to the right-hand side, else false.

package octopuscodes.com.demo;

public class Demo {

	public static void main(String[] args) {
		int a = 10, b = 5;
		boolean result1 = a != b;
		System.out.println("result 1: " + result1);

		int c = 7, d = 7;
		boolean result2 = c != d;
		System.out.println("result 2: " + result2);
	}

}
result 1: true
result 2: false
 

3. “Greater than” Operator(>)

This checks whether the first operand is greater than the second operand or not. The operator returns true when the operand at the left-hand side is greater than the right-hand side.

    package octopuscodes.com.demo;
    
    public class Demo {
    
    	public static void main(String[] args) {
    		int a = 10, b = 5;
    		boolean result1 = a > b;
    		System.out.println("result 1: " + result1);
    
    		int c = 7, d = 17;
    		boolean result2 = c > d;
    		System.out.println("result 2: " + result2);
    	}
    
    }
    result 1: true
    result 2: false
    
     

    4. “Greater than or equal to” Operator(>=)

    This checks whether the first operand is greater than or equal to the second operand or not. The operator returns true when the operand at the left-hand side is greater than or equal to the right-hand side.

      package octopuscodes.com.demo;
      
      public class Demo {
      
      	public static void main(String[] args) {
      		int a = 10, b = 5;
      		boolean result1 = a >= b;
      		System.out.println("result 1: " + result1);
      
      		int c = 7, d = 7;
      		boolean result2 = c >= d;
      		System.out.println("result 2: " + result2);
      		
      		int e = 7, f = 14;
      		boolean result3 = e >= f;
      		System.out.println("result 3: " + result3);
      	}
      
      }
      result 1: true
      result 2: true
      result 3: false
      
       

      5. “Less than” Operator(<)

      This checks whether the first operand is less than the second operand or not. The operator returns true when the operand at the left-hand side is less than the right-hand side.

      package octopuscodes.com.demo;
      
      public class Demo {
      
      	public static void main(String[] args) {
      		int a = 10, b = 5;
      		boolean result1 = a < b;
      		System.out.println("result 1: " + result1);
      
      		int c = 7, d = 17;
      		boolean result2 = c < d;
      		System.out.println("result 2: " + result2);
      	}
      
      }
      result 1: false
      result 2: true
      
       

      6. "Less than or equal to" Operator(<=)

      This checks whether the first operand is greater than or equal to the second operand or not. The operator returns true when the operand at the left-hand side is greater than or equal to the right-hand side.

      package octopuscodes.com.demo;
      
      public class Demo {
      
      	public static void main(String[] args) {
      		int a = 10, b = 5;
      		boolean result1 = a <= b;
      		System.out.println("result 1: " + result1);
      
      		int c = 7, d = 7;
      		boolean result2 = c <= d;
      		System.out.println("result 2: " + result2);
      
      		int e = 2, f = 7;
      		boolean result3 = e <= f;
      		System.out.println("result 3: " + result3);
      	}
      
      }
      result 1: false
      result 2: true
      result 3: true
      

      The post Relational Operators in Java appeared first on OctopusCodes.

      ]]>