# 類的寫法:
## 類的屬性在堆空間里
##
## 類的方法在棧空間里
~~~
package com.msb;
/*
*
創建類 :人類
*
*
* */
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
public class Person {
//名詞
int age;
String name;
double height;
double weigh;
public void eat(){
System.out.println("我喜歡吃飯");
}
public void sleep(String addres){
System.out.println("我喜歡在"+addres+"睡覺");
}
public String introduce(){
return "我的名字是"+name+"年齡是"+age+"身高是"+height+"體重是"+weigh;
}
}
~~~