
C:\PackageStudy> set classpath=.;C:\PackageStudy\MyClass
// 현재 디렉토리는 PackageStudy폴더라고 가정
절대경로
C:\PackageStudy\MyClass
상대경로
.\MyClass
// 저장위치 \com\wxfx\smart
com.wxfx.smart.Circle c1 = new com.wxfx.smart.Circle(3,5);
// 저장위치 \com\fxmx\simple
com.fxmx.simple.Circle c2 = new com.fxmx.simple.Circle(3,5);

package com.wxfx.smart;
public class Circle{
}

import java.util.*; // 패키지로 묶인 전체 클래스에 대한 패키지 선언, 너무 많으므로 비추천
import com.wxfx.smart.Circle;
// import com.fxmx.simple.Circle; 무슨 Circle인지 모름
class ImportCircle {
public static void main(String args[]) {
Circle c1 = new Circle(3.5); // com.wxfx.smart의 Circle
System.out.println("반지름 3.5 원 넓이: " + c1.getArea());
Circle c2 = new Circle(5.5); // com.wxfx.smart의 Circle
System.out.println("반지름 5.5 원 넓이: " + c2.getArea());
}
}