1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

stackoverflow

Discussion in 'JAVA, SOA and Application Development' started by ghostrider, Mar 29, 2013.

  1. ghostrider

    ghostrider Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    This might be a very basic question but still I am not able to figure out why is the foll code giving stackoverflow exception in main??
    Code (Text):


    public class HelloWorld{
         public static void main(String []args)
         {
            System.out.println("Hello World");
            Animal c = new Animal();
         }
    }
    class Animal
    {
    Animal e = new Animal();
    }