title: When is it OK to create object of a class inside a method of that class?
body: <pre><code>public class TestClass(){
      public static void main(String []args) {
          TestClass t1 = new TestClass();
          t1.anything();
      }
  }
  </code></pre>
  
  <p>Is it not strange to create a object in the definition of same class? Because then in response - this object creates a new object, then this new object creates another, and the infinite loop begins to never end until the memory is full.</p>