title: how to resolve StackOverFlowError?
body: <p>My Inner and outer class file here:-</p>
  
  <pre><code>package com.demo;
  
  public class Outer {
  int outer_x=100;
  
  void test(){
      Inner inner =new Inner();
      inner.display();
  }
  public class Inner {
  void display(){
      Outer ob=new Outer();
      ob.test();
  
      System.out.println("display: outer_x= "+outer_x);
  }
  }
  
  }
  </code></pre>
  
  <p>Another  main class acess outer class member :-</p>
  
  <pre><code>package com.demo;
  
  class InnerClassDemo{
      public static void main(String args[]){
          Outer outer=new Outer();
          outer.test();
      }
  }
  </code></pre>
  
  <p>Exception:-</p>
  
  <pre><code>Exception in thread "main" java.lang.StackOverflowError
      at com.demo.Outer.&lt;init&gt;(Outer.java:3)
      at com.demo.Outer$Inner.display(Outer.java:12)
      at com.demo.Outer.test(Outer.java:8)
  </code></pre>
  
  <p>How can resolve this issue ,pls give me any idea?</p>