|
目录 类与结构的实例比较 类与结构的差别 如何选择结构还是类 一.类与结构的示例比较: 结构示例: public struct person { string name; int height; int weight public bool overweight() { //implement something } } 类示例: public class testtime { int hours; int minutes; int seconds; public void passtime() { //implementation of behavior } } 调用过程:
本文关键:c#中结构与类的区别
|