3-1
class People {
	int age;
	String name;
	double height;

	void laugh() {
		System.out.println("Haaha...");
	}

	public static void main(String[] args) {
		System.out.println("mainִ");
		People p = new People();
		p.laugh();
	}
}

 3-2
class People {
	int age;
	String name;
	double height;

	People() {
		name="";
		age=25;	
		height=160.0;
	}

	void laugh() {
		System.out.println("Haaha...");
	}

	public static void main(String[] args) {
		System.out.println("mainִ");
		People p = new People();
		p.laugh();
	}
}


3-3
class People {
	int age;
	String name;
	double height;

	People(int a, String b, double c) {
		age = a;
		name = b;
		height = c;
	}

	void laugh() {
		System.out.println("Haaha...");
	}

	public static void main(String[] args) {
		System.out.println("mainִ");
		People p = new People(27, "", 178.0);
            People p1 = new People(28, "Ż", 176.7);
            System.out.println(p.name);
            System.out.println(p1.name)
		p.laugh();
	}
}


3-4
//Ʒ
public class Item {
	private String itemID;//ƷID
	private String shortDescription;//Ʒļ
	private String longDescription;//Ʒϸ
	private double cost;//Ʒ۸

	//ƷĹ췽,ͨ÷,ʵʵƷ
	public Item(String itemID, String shortDescription, String longDescription,double cost) {
		setItemID(itemID);
		setShortDescription(shortDescription);
		setLongDescription(longDescription);
		setCost(cost);
	}
	//ȡƷID
	public String getItemID() {
		return (itemID);
	}
	//ƷID
	protected void setItemID(String itemID) {
		this.itemID = itemID;
	}
	public String getShortDescription() {
		return (shortDescription);
	}
	protected void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}
	public String getLongDescription() {
		return (longDescription);
	}
	protected void setLongDescription(String longDescription) {
		this.longDescription = longDescription;
	}
	public double getCost() {
		return (cost);
	}
	protected void setCost(double cost) {
		this.cost = cost;
	}
}


3-5
class Box {
	double width;
	double height;
	double depth;

	Box(double w, double h, double d) {
		width = w;
		height = h;
		depth = d;
	}

	double volume() {
		return width * height * depth;
	}
}

class BoxDemo {
	public static void main(String args[]) {
		Box mybox1 = new Box(10, 20, 15);
		Box mybox2 = new Box(3, 6, 9);
		double vol;
		vol = mybox1.volume();
		System.out.println("Volume is " + vol);
		vol = mybox2.volume();
		System.out.println("Volume is " + vol);
	}
}
