// Example to illustrate aggregation and nested classes class Sphere_0 { class Center { int x,y; } Center C = new Center(); float radiusOfCircle; public Sphere_0 (int xCenter, int yCenter, float radius) { C.x=xCenter; C.y=yCenter; radiusOfCircle = radius; } public float area() { return (float)(4.0*Math.PI*Math.pow((double)radiusOfCircle,2.0)); } } class RoundShapeExample { public static void main(String[] args) { Sphere_0 s = new Sphere_0 (5,5,2.5f); System.out.println("Area of the sphere is " + s.area()); } }