Skip to content

Instantly share code, notes, and snippets.

@chochos
Created September 24, 2015 15:30

Revisions

  1. chochos created this gist Sep 24, 2015.
    16 changes: 16 additions & 0 deletions Skip.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    import java.lang.reflect.*;

    public class Skip {
    public final String s;
    public Skip(String s) {
    this.s=s;
    }

    public static void main(String... args) throws Exception {
    Skip me = new Skip("Initial");
    Field f = Skip.class.getField("s");
    f.setAccessible(true);
    f.set(me, "p0wned!");
    System.out.println(me.s);
    }
    }