fork download
  1. import java.lang.reflect.Field;
  2. import java.util.Arrays;
  3. import java.util.Collections;
  4. import java.util.List;
  5.  
  6.  
  7. public class Main {
  8. public static void main(String[] args) throws Exception {
  9. Class cache = Integer.class.getDeclaredClasses()[0];
  10. Field c = cache.getDeclaredField("cache");
  11. c.setAccessible(true);
  12. Integer[] array = (Integer[]) c.get(cache);
  13. List<Integer> f = Arrays.asList(array);
  14. Collections.shuffle(f);
  15.  
  16. System.out.printf("%d",2 + 2);
  17. }
  18. }
Success #stdin #stdout #stderr 0.1s 56264KB
stdin
Standard input is empty
stdout
-120
stderr
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by Main (file:/home/SjkOqK/tested.zip) to field java.lang.Integer$IntegerCache.cache
WARNING: Please consider reporting this to the maintainers of Main
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release