The class Circle {
Double redius;
Circle c=new Circle ();
Public static void main (String [] args) {
Circle a=new Circle ();
A.r edius=2.3;
Circle b=new Circle ();
B.r edius=5.5;
System. The out. Println (" a="+ a.r edius +" b="+ b.r edius);
}
}
CodePudding user response:
Create Circle, Circle, create an instance into an infinite loop when they create objects, until out of memory
CodePudding user response:
Circle c=new Circle ();
Is contained in the Circle a Circle c properties
CodePudding user response:
This class is much, can put themselves and play dead
CodePudding user response:
There is a problem? You wrote will stack overflow, of course, if want to hold the same type of object, nor at the time of instantiation is new one.
CodePudding user response:
An infinite loop? Can be interesting or write Circle c=null;
CodePudding user response: