// BodyMain1.java:  recursive class with classwide (static) variable

public final class Body1  {

   static long nextID = 0;
   long idNum;
   String nameFor;
   Body1 orbits;

   public static void main (final String[] args)  {
      final Body1 sun   = new Body1(); // default constructor
      sun.idNum   = Body1.nextID++;
      sun.nameFor = "Sol";
      sun.orbits  = null;        // "Sol" orbits no body

      final Body1 earth   = new Body1();
      earth.idNum   = Body1.nextID++;
      earth.nameFor = "Earth";
      earth.orbits  = sun;
   }
}