网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容 知识问答

C#数组如何添加整个类下的成员

时间:2024-10-12 05:54:55

1、类的成员如图所示:

C#数组如何添加整个类下的成员

3、所有的代码如下:using System;namespace ArrayApplication{ class MyArray { static void Main(string[] args) { Box[] n = new Box[10]; /* n 是一个带有 10 个对象的数组 *//*第一组数据*/n[1].length=18.0;n[1].breadth=20.3;n[1].height=30.5; } }class Box { public double length; // 长度 public double breadth; // 宽度 public double height; // 高度 }}

C#数组如何添加整个类下的成员
© 2025 五度知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com