public class Body
{
public long idNum;
public String name;
public Body orbitis;
public static int nextID = 0;
public static final double G = 9.81;
}
Body sun = new Body();
sun.idNum = Body.nextId++;
sun.name = "Sun";
sun.orbits = null;
Body earth = new Body();
earth.idNum = Body.nextId++;
earth.name = "Earth";
earth.orbits = sun;