int x
int y
public Point() {
}
public Point(int x, int y) {
this.x = x
this.y = y
}
public Point(int x) {
this.x = x
this.y = x
}
public double distance() {//求当前点到原点的距离
return Math.sqrt((x * x + y * y))
}
public double distance(int x1, int y1) {//求当前点到(x1,y1)的距离
return Math.sqrt((x-x1)*(x-x1) + (y-y1) * (y-y1))
}
public double distance(Point other){
int x2 = other.x
int y2 = other.y
return Math.sqrt((x-x2)*(x-x2) + (y-y2) * (y-y2))
}
}
对几个容易错的稍微注解下,1 D
2 C final修饰
3 B
4 B
5 C
6 B
7 C
8 C
9 B JAVA里面都是写作null的,而不是NULL
10 A: String.substring()大小写问题
11 C
12C
13A
14C
15A
16B
17C
18C
19D
20D管道流,此流一般用于多线
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)