archfind.java

来自「java写的Archreport」· Java 代码 · 共 36 行

JAVA
36
字号
/**	File Name:    	ArchFind.java	Author:	黄增博   #B02251132	Date:		March 20 2004	Description:	The ArchFind class records information about archeological                        finds. Specifically it records the x-position, y-position,                        depth of find and a descriptive name.**/class ArchFind{	private double xPos, yPos; // location of find	private double depth;	//depth of find	private String name;	// the find's name	public ArchFind(double x, double y, double d, String n){		xPos=x;		yPos=y;		depth= d;		name =  n;	}	public String getName(){return name;}	public double getXPos(){return xPos;}	public double getYpos(){return yPos;}        public double getDepth(){return depth;}// give the depth	/*returns the distance between two finds */	public double distanceBetween(ArchFind other){	return Math.sqrt(Math.pow(xPos-other.getXPos(),2)+Math.pow(yPos-other.getYpos(),2));	}//work out the distence	/*return a String presentation */	public String toString(){		return "name: " + name + " (" + xPos + "," + yPos + "," + depth + ")";	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?