package test; public class Point { int x,y; public Point() { System.out.println("Point constructor"); } void pos() { System.out.println("( " + x + " , " + y + " )" ); } }
import test.*; public class Line { public Line() { System.out.println("Line Constructor"); } public static void main(String[] args) { Point p = new Point(); // p.pos(); // アクセス不可 } }