Skip to content

Instantly share code, notes, and snippets.

@coolsasindu
Created March 15, 2021 09:18
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/153fcdcc788347d6dd1aab15f418b41c to your computer and use it in GitHub Desktop.
Save coolsasindu/153fcdcc788347d6dd1aab15f418b41c to your computer and use it in GitHub Desktop.
class Boolean_and {
public static void main(String args[]){
int a = 5 ;
int b = 4 ;
if( a & b ){
//true
System.out.println("yes");
}else{
//false
System.out.println("No");
}
}
}
class Boolean_com {
public static void main(String args[]){
int a = 5 ;
int b = 4 ;
if( a ~ b ){
//true
System.out.println("yes");
}else{
//false
System.out.println("No");
}
}
}
class Boolean_or {
public static void main(String args[]){
int a = 5 ;
int b = 4 ;
if( a | b ){
//true
System.out.println("yes");
}else{
//false
System.out.println("No");
}
}
}
class Boolean_xor {
public static void main(String args[]){
int a = 5 ;
int b = 4 ;
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