검색결과 리스트
글
20130508
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package point4dtest;
/**
*
* @author User
*/
class Circle {
int x, y, r;
Circle() {
this(0, 0, 0);
}
Circle(int x, int y, int r) {
this.r = r;
this.x = x;
this.y = y;
}
}
class CircleC {
Point center = new Point();
int r;
CircleC()
{
this(0,0,0);
}
CircleC(int x,int y, int z)
{
center.x=x;
center.y=y;
this.r=r;
}
}
class CircleI extends Point {
int r;
CircleI() {
this(0, 0, 0);
}
CircleI(int x, int y, int r) {
this.r = r;
this.x = x;
this.y = y;
}
}
class Point {
int x, y;
Point(int x, int y) {
this.x = x;
this.y = y;
}
Point() {
this(0, 0);
}
/*
String getLocation() {
return "x :" + x + ", y :" + y;
}
*/
}
class Point3D extends Point {
int z;
Point3D(int x, int y, int z) {
super(x,y);
//this.x = x;
//this.y = y;
this.z = z;
}
Point3D() {
this(0, 0, 0);
}
String getLocation()
{
return "x :" + x + ", y :"+ y+"z :"+z;
}
}
class Point4D extends Point3D {
int t;
Point4D(int x, int y, int z, int t) {
super(x,y,z);
/*this.x = x;
this.y = y;
this.z = z;
*/
this.t = t;
}
Point4D() {
this(0, 0, 0, 0);
}
String getLocation() {
return super.getLocation() + " t : " + t;
}
}
public class Point4DTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Point p = new Point(0, 0);
Point p2 = new Point();
Point3D p3 = new Point3D(1, 2, 3);
Point4D p4 = new Point4D(1, 2, 3, 4);
CircleC c2 = new CircleC();
Point4D p4d = new Point4D();
System.out.println("p.x : " + p.x + " p.y :" + p.y + " p2.x : " + p2.x + " p2.y : " + p2.y + " p3.z : " + p3.z + " p4.x : " + p4.x + " p4.y : " + p4.y + " p4.z : " + p4.z + " p4.t : " + p4.t + " c2.center.x : "
+c2.center.x);
System.out.println(p4d.getLocation());
}
}
'학교 실습 > HCI' 카테고리의 다른 글
20130522 HCI (0) | 2013.05.22 |
---|---|
130513 (0) | 2013.05.13 |
20130507 (0) | 2013.05.07 |
HCI 20130501 (0) | 2013.05.01 |
HCI 20130429 (0) | 2013.04.29 |