Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Java

public class Temp {
    public static void main(String[] args) throws Exception {
        Temp.class.getMethod("main", String[].class).invoke(null, new Object[]{null});
    }
}

Gives a bunch of weird stack traces and exceptions

  • InvocationTargetException once with a gazillion times 'caused by InvocationTargetException'
  • InvocationTargetException another gazillion times without stack trace, only ... 1024 more
  • finally ending in StackOverflowError

Also posted in Call a method without calling itCall a method without calling it

Java

public class Temp {
    public static void main(String[] args) throws Exception {
        Temp.class.getMethod("main", String[].class).invoke(null, new Object[]{null});
    }
}

Gives a bunch of weird stack traces and exceptions

  • InvocationTargetException once with a gazillion times 'caused by InvocationTargetException'
  • InvocationTargetException another gazillion times without stack trace, only ... 1024 more
  • finally ending in StackOverflowError

Also posted in Call a method without calling it

Java

public class Temp {
    public static void main(String[] args) throws Exception {
        Temp.class.getMethod("main", String[].class).invoke(null, new Object[]{null});
    }
}

Gives a bunch of weird stack traces and exceptions

  • InvocationTargetException once with a gazillion times 'caused by InvocationTargetException'
  • InvocationTargetException another gazillion times without stack trace, only ... 1024 more
  • finally ending in StackOverflowError

Also posted in Call a method without calling it

Source Link
Mark Jeronimus
  • 7.2k
  • 6
  • 18
  • 23

Java

public class Temp {
    public static void main(String[] args) throws Exception {
        Temp.class.getMethod("main", String[].class).invoke(null, new Object[]{null});
    }
}

Gives a bunch of weird stack traces and exceptions

  • InvocationTargetException once with a gazillion times 'caused by InvocationTargetException'
  • InvocationTargetException another gazillion times without stack trace, only ... 1024 more
  • finally ending in StackOverflowError

Also posted in Call a method without calling it