c1.setRadius(1+1); //연산이 먼저 처리값 호출
참조 호출

[접근제한] <반환형> <메서드명> ([매개변수1], ..., [매개변수n] {... }
//접근제한, 반환형: 상관없음
//메서드명: 반드시 같아야함
//매개변수: 인자의 개수나 타입이 반드시 달라야 !!
[접근제한] [static] <자료형> <식별자>;
instance 멤버 필드
static 멤버 필드
static final double PI = 3.14;
//static 멤버 필드 접근시 Circle.PI (클래스.멤버변수)
instance 메서드
static 메서드




public class Circle_sp {//절차지향
static final double PI = 3.14159265;
static double getArea(double radius) {
return PI * radius * radius;
}
public static void main(String[] args) {
double r1=1;
double r10=10;
double area1 = getArea(r1); //PI*r1*r1;
double area10 = getArea(r10); //PI*r10*r10;
//static: Circle_sp라는 객체 생성x, getArea 직접 호출 가능
System.out.println("반지름"+r1+"인 원의 넓이는 "+area1);
System.out.println("반지름"+r10+"인 원의 넓이는 "+area10);
}
}