The following is the landlord's answer.
Topic 2:
Category point {}
Class Circle extends Point{// inherits the Point class.
public int x; //X coordinate
public int y; //Y coordinate
Public int r;; //Radius
The public double getArea(int r){// method used to find the area.
Returns 3.14 * r * r;
}
Public circle (int x, int y, int r){// constructor.
this.x = x
this.y = y
this.r = r
}
Public Circle() {// constructor
}
}
Common class test {//main function
Public static void main(String[] args) {
Circle circle=new Circle( 1,2,3); //Instantiate the object of the Circle class
System.out.println ("coordinate is" +circle.x+ ","+circle.y+"\t radius is "+circle.r"); //output its center coordinate radius.
system . out . println(" area is "+circle . get area(circle . r)); //output area
}
}
Theme 3:
Class College {//Class College
Public void method () {//
System.out.println ("Guilin University of Aeronautics and Astronautics");
}
}
Public class schools {//class schools
Public static void main(String[] args) {
College c 1 = new college ();
for(int I = 0; I<3; i++) {
c 1 . xianshi();
}
}
}