ssssshhocking

Untitled

Sep 18th, 2020
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. class Test
  2. {
  3.     boolean[] array = new boolean[3];
  4.     int count = 0;
  5.  
  6.     void set(boolean[] arr, int x)
  7.     {
  8.         arr[x] = true;
  9.         count++;
  10.     }
  11.  
  12.     void func()
  13.     {
  14.         if(array[0] && array[++count - 2] | array [count - 1])
  15.             count++;
  16.  
  17.         System.out.println("count = " + count);
  18.     }
  19.  
  20.  
  21.     public static void main(String[] args)
  22.     {
  23.         Test object = new Test();
  24.         object.set(object.array, 0);
  25.         object.set(object.array, 1);
  26.         object.func();
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment