How to use the relational operator in Java?
Relational operators used to compare any combination of integers, floating-point numbers, or characters. The result of relational operators is always in a boolean value, true or false. It is mostly used in an if statement test.
There are four relational operators in Java:
- > greater than
- >= greater than or equal to
- < less than
- <= less than or equal to
An here are the result of the program:
25 is greater than 10
Hey, I am not a kid anymore
d is less than f