개발자에게 배우는 개발자교육! 구로 오라클자바교육학원 www.oraclejava.co.kr
개발자에게 배우는 개발자교육! 구로 오라클자바교육학원 www.oraclejava.co.kr
클래스와 인스턴스 예제(1)
class Person {
public int age;
public long height;
public float weight;
}
public int age;
public long height;
public float weight;
}
public class PersonTestMain {
public static void main(String[] args) {
Person brother = new Person();
brother.age = 100;
brother.height = 170L;
brother.weight = 67.0F;
System.out.println(“age : ” + brother.age);
System.out.println(“height : ” + brother.height);
System.out.println(“weight : ” + brother.weight);
}
}
public static void main(String[] args) {
Person brother = new Person();
brother.age = 100;
brother.height = 170L;
brother.weight = 67.0F;
System.out.println(“age : ” + brother.age);
System.out.println(“height : ” + brother.height);
System.out.println(“weight : ” + brother.weight);
}
}