Call Main Recursively
问题 public class Demo { static int i=0; public static void main(String args[]) { System.out.println("Hello"+(i++)); main(args); } } In this program I am calling main with instance variable. It runs properly upto some point but after some Hello prints it gives StackOverFlow Exception. So i put int to find how many times it gets printed. I run this program it gives Exception after i=4158 . But I run it several times it gives Exception at different value of i like 4155,4124,4154 etc. As I know here