Skip to content

Instantly share code, notes, and snippets.

@coolsasindu
Last active March 12, 2021 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coolsasindu/9644adb0ea97e1dcf698d93f4816ab8e to your computer and use it in GitHub Desktop.
Save coolsasindu/9644adb0ea97e1dcf698d93f4816ab8e to your computer and use it in GitHub Desktop.
public class Relational {
public static void main(String[] args) {
int a = 25 ;
int b = 25 ;
// <, <=, >, >= ,== , !=
if( a < b ){
//true
System.out.println("yes");
}else{
//false
System.out.println("No");
}
if( a > b ){
//true
System.out.println("yes");
}else{
//false
System.out.println("No");
}
if( a<= b ){
//true
System.out.println("yes");
}else{
//false
System.out.println("No");
}
if(a>=b ){
//true
System.out.println("yes");
}else{
//false
System.out.println("No");
}
if(a==b ){
//true
System.out.println("yes");
}else{
//false
System.out.println("No");
}
if(a!=b ){
//true
System.out.println("yes");
}else{
//false
System.out.println("No");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment