- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Relational Operators
There are following relational operators supported by Java language.
Assume variable A holds 10 and variable B holds 20, then −
Operator | Description | Example |
---|---|---|
== (equal to) | Checks if the values of two operands are equal or not, if yes then condition becomes true. | (A == B) is not true. |
!= (not equal to) | Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. | (A != B) is true. |
> (greater than) | Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. | (A > B) is not true. |
< (less than) | Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. | (A < B) is true. |
>= (greater than or equal to) | Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. | (A >= B) is not true. |
<= (less than or equal to) | Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true. | (A <= B) is true |
- Related Articles
- What are the relational operators in Java?
- Relational Operators in C++
- C++ Relational and Equality Operators
- Relational Set Operators in DBMS
- Basic Operators in Relational Algebra
- Relational Operators in Dart Programming
- Relational and Logical Operators in C
- Relational and comparison operators in C++
- What are relational operators in C#?
- How to implement relational and logical operators in JShell in Java 9?
- Relational Operators on STL Array in C++
- Extended Operators in Relational Algebra in C++
- What are relational operators in C language?
- Comparing String objects using Relational Operators in C++
- Find maximum in an array without using Relational Operators in C++

Advertisements