Lost Temple

学着敲了一段java代码。

package testyang;

public class mytest {
	public static void main(String[] args)
	{
		System.out.println("我的第N次的第一个java程序");
		mytest md = new mytest();
		md.test1();
		System.out.println("---------------------");

		Circle bigcircle = new Circle(25);
// 11 行报错,因为()里面不带参数,所以调用Circle的第一个构造方法(26 line),假如你不构造,就会抱错,假如你把()里面加一个参数,就会调用第二个构造方法了(32 line)
	    Circle smallcircle = new Circle();
	    Circle mediumcircle = new Circle(10);
	    System.out.println("面积大小 大,小,中"+"\n" +bigcircle.getarea()+"\n"+
	    smallcircle.getarea()+"\n"+ mediumcircle.getarea());

	}
	private void test1() {
		// TODO Auto-generated method stub
		System.out.println("我的第一个方法");
	}
}

class Circle {
	double r;
	Circle(){
		r = 1.0;
	}
	;

	Circle(double newr) {
		r = newr;
	}
	double getarea(){

		return r*r*Math.PI;
	}

}