CLASS與STRUCT的差別
| CLASS | STRUCT |
|---|---|
| CONSTRUCTOR可以不用接收任何參數 | CONSTRUCTOR一定要接收參數 |
| 可以有DESTRUCTOR | 不可以有DESTRUCTOR |
| 可以繼承其他CLASS與IMPLEMENT INTERFACE | 不可以繼承其他CLASS,但可以IMPLEMENT INTERFACE |
| 正常來說可以被其他CLASS繼承 但如果CLASS有加上SEALD,則不能被繼承 |
不可以被其他CLASS繼承,因為STRUCT其實是一種SEALD型態的CLASS |