This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Well this is because every time you create an instance of test class, one more instance is created in it (t declared at (1)). When that instance is created, one more instance is created in it and so on.
But when you make that instance static, then it get's initialized only once and not every time when you create an instance.
The StackOverflowError occurs because there are too many pending constructor calls. If you modify your class and add a big object to it as int i = new int, then you will get an OutOfMemoryError...