Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.lang.reflect.Field;
  2.  
  3. public class Foo {
  4.     static {
  5.         try {
  6.             Integer three = 3;
  7.             Field value = Integer.class.getDeclaredField("value");
  8.             value.setAccessible(true);
  9.             value.setInt(three, 4);
  10.         } catch (NoSuchFieldException | IllegalAccessException ignored) {
  11.         }
  12.     }
  13.  
  14.     public static void main(String... args) {
  15.         Integer three = 3;
  16.         Integer four = 4;
  17.         System.err.println(three.equals(four));
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement