fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. static int left;
  11. static int right;
  12.  
  13. public static void main(String[] args) {
  14. left = 5; //Integer.parseInt(args[0]);
  15. right = 3; //Integer.parseInt(args[1]);
  16.  
  17. class Binary {
  18. private int left;
  19. private int right;
  20.  
  21. public Binary(){
  22. this.left = Ideone.left;
  23. this.right = Ideone.right;
  24. }
  25.  
  26. public void and(){
  27. int n = left & right;
  28. String m = Integer.toBinaryString(n);
  29. System.out.println(m);
  30. }
  31. }
  32.  
  33. Binary i = new Binary();
  34. i.and();
  35. }
  36. }
Success #stdin #stdout 0.06s 32524KB
stdin
Standard input is empty
stdout
1