Much more code or learn what to write, remember junction post
import java.util.ArrayList; Import the Java. Util. HashMap; Import the Java. Util. List; import java.util.Map; Import the Java. Util. Set;
Public class Circle { Private Map The map=new HashMap<> (a);
Public Circle () { super(); InitCircle (); } Public void initCircle () { for(int i=1; i<=50; I++) { The map. The put (I, Math. PI * I * I); } } Public Map The getMap () { Return the map; } Public List GetRad () { List List=new ArrayList<> (a); Return null if (map. IsEmpty ()); Set Keys=map. The keySet (); For (Integer key: keys) { List. The add (key); } return list; } Public static void main (String [] args) { Circle cir=new Circle (); List List=cir. GetRad (); //test For (Integer rad: list) { if(! List. IsEmpty ()) { Double area=cir. The getMap (). The get (rad); System. Out. Println (" area: "+ area); } } } }