글번호
49605

13주차_자바_하트6

작성자
김영준
작성일
2019.05.28.
수정일
2019.05.28.
조회수
178

class F { int age, height, weight;

F( ) {

System.out.println("인자없는 생성자"); }

F( int a, int h, int w )

{ age=a; height =h; weight=w;

 

System.out.println("인자 3개인 생성자");

System.out.println("인자 3개인 생성자"+ a+h+w ); }

 

void eat() { System.out.print("소식"); }

void sleep() { System.out.print("단잠"); }

}

public class 6 {

public static void main(String args[ ]) {

F aa = new F();

F bb= new F(29, 180, 78);

aa.eat( ); bb.sleep( ); } }

 

첨부파일
첨부파일이(가) 없습니다.