All pastes #502088 Raw Edit

theBohemian

public java v1 · immutable
·published 2007-05-22 10:39 UTC
rendered paste body
import java.lang.reflect.*;public class Test3{ public static void main(String[] args) throws Exception {   System.out.print("static long: ");   System.out.println(gimmeLong());   System.out.print("virtual long: ");   System.out.println(new Test3().gimmeLongV());   Method m = Test3.class.getDeclaredMethod("gimmeLong", null);      Object o = m.invoke(null, null);   System.out.println(o);   long l = ((Long) o).longValue();   System.out.println(l);   if ( l != gimmeLong() )     System.out.println("I am broken!"); } static long gimmeLong() {  return 1000L; } long gimmeLongV() {  return 1000L; }}