fork download
  1. import java.lang.reflect.Field;
  2.  
  3. class PequalNP
  4. {
  5. public static void main (String[] args) throws java.lang.Exception
  6. {
  7. Class cache = Integer.class.getDeclaredClasses()[0];
  8. Field c = cache.getDeclaredField("cache");
  9. c.setAccessible(true);
  10. Integer[] array = (Integer[]) c.get(cache);
  11. array[132] = array[133];
  12.  
  13. System.out.printf("%d",2 + 2);
  14. }
  15. }
Success #stdin #stdout #stderr 0.13s 34340KB
stdin
Standard input is empty
stdout
5
stderr
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by PequalNP (file:/home/p20VTP/tested.zip) to field java.lang.Integer$IntegerCache.cache
WARNING: Please consider reporting this to the maintainers of PequalNP
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