★★★如何创建包?★★★ ★★★如何创建包?★★★
我自己创建了一个包,具体如下,不知如何编译?
还有,classes目录 是否要自己新建?
哪位大侠能告诉我具体方法?越详细越好?拜托了?
// Fig. 9-6: Point.java
// Defination of class Point
package com.deitel.jhtp3.ch09;
public class Point {
protected int x, y;
// no-argument constructor
public Point() { setPoint( 0, 0 ); }
// constructor
public Point( int a, int b ) { setPoint( a, b ); }
// Set x and y coordinates of Point
public void setPoint( int a, int b )
{
x = a;
y = b;
} // end of setPoint
// get x coordinate
public int getX() { return x; }
// get y coordinate
public int getY() { return y; }
// Convert the point into a String representation
public String toString()
{ return "[" + x + "," + y + "]"; }
} // end of class