These operators are used to check for relations like equality, greater than, less than. They return boolean result after the comparison and are extensively used in looping statements as well as conditional if else statements.
- ==, Equal to : returns true if left hand side is equal to right hand side.
- !=, Not Equal to : returns true if left hand side is not equal to right hand side.
- <, less than : returns true if left hand side is less than right hand side.
- <=, less than or equal to : returns true if left hand side is less than or equal to right hand side.
- >, Greater than : returns true if left hand side is greater than right hand side.
- >=, Greater than or equal to: returns true if left hand side is greater than or equal to right hand side.
Program:
public class Relational { public static void main(String args[]) { int a = 10; int b = 20; System.out.println("a == b = " + (a == b) ); System.out.println("a != b = " + (a != b) ); System.out.println("a > b = " + (a > b) ); System.out.println("a < b = " + (a < b) ); System.out.println("b >= a = " + (b >= a) ); System.out.println("b <= a = " + (b <= a) ); } }Output:
a == b = false a != b = true a > b = false a < b = true b >= a = true b <= a = false- Progamming is what actually means ?
- What is software development ?
- How we categorized software development in different manner.
C Programming
C Plus Plus
Python
Java Development
Web Designing
Javascript
Mysql
Oracle
C Plus Plus
Python
Java Development
Web Designing
Javascript
Mysql
Oracle
We cover all the programming concepts in various programming languages, this tutorials are very help full for bigener as well as Experience developer, for the ease of understanding we categorized programming in different manner likewise.