Java/chapter2

ch03 Person

낭구리 2021. 8. 25. 14:03
package ch03;

public class Person {

	int height;
	int weight;
	String name;
	int age;
	String orderNumber;
	int sellerPhoneNumber;
	String address;
	int Date;
	int time;
	int price;
	String menu;
	
	
	public Person(int height, int weight, String name, int age, String orderNumber, int sellerPhoneNumber, String address,
			int date, int time, int price, String menu) {
		super();
		this.height = height;
		this.weight = weight;
		this.name = name;
		this.age = age;
		this.orderNumber = orderNumber;
		this.sellerPhoneNumber = sellerPhoneNumber;
		this.address = address;
		Date = date;
		this.time = time;
		this.price = price;
		this.menu = menu;
	}

public void showperson() {
		
		System.out.println("키는 " + height +"cm입니다");
		System.out.println("몸무게는 " + weight +"kg입니다");
		System.out.println("이름은 " + name +"입니다");
		System.out.println("나이는 " + age +"살입니다");
		System.out.println("접수번호 :" + orderNumber +"입니다");
		System.out.println("주문 핸드폰번호 : " + sellerPhoneNumber +"입니다");
		System.out.println("주문 집주소 : " + address +"입니다");
		System.out.println("주문날짜 : " + Date +"입니다");
		System.out.println("주문시간 : " + time +"입니다");
		System.out.println("주문가격 :" + price +"입니다");
		System.out.println("메뉴번호 : " + menu +"입니다");
	}

	public static void main(String[] args) {
		
		Person person1 = new Person(180, 78, "Tomas", 37, "202106250003", 01023450001, "부산시 해운대구 우동 111-333", 20210625, 130258, 35000, "0003");
		
		person1.showperson();
	}
}

 

 

'Java > chapter2' 카테고리의 다른 글

ch04 Student Bus Subway  (0) 2021.08.25
ch03 UserInfo(생성자)  (0) 2021.08.25
ch03 Bus  (0) 2021.08.25
ch02 FormainTest1  (0) 2021.08.25
ch02 Student 메서드  (0) 2021.08.23