有一个关于 VS( C#)的问题,为什么会这样

2017-04-05 13:51:57 +08:00
 ZERO1411


1444 次点击
所在节点    问与答
10 条回复
AsherG
2017-04-05 14:00:09 +08:00
看看你 Student 类咯
ZERO1411
2017-04-05 14:02:45 +08:00
@AsherG Student 类没有问题啊 而且我直接复制别人的正确程序过来 还是有这个错误 但是别人的项目就没有这个错误
hjc4869
2017-04-05 14:05:04 +08:00
你的 Student 类是不是 private 或者 internal ?
AsherG
2017-04-05 14:05:47 +08:00
Student 类是 public 的吗?
andrewpsy
2017-04-05 14:11:00 +08:00
otakustay
2017-04-05 19:49:43 +08:00
你一个 public 的方法能接受一个 Student 类的实例,那说明在 public 的地方别人能创建 Student 实例,那说明外面能访问到 Student 类,那说明 Student 类也是 public 的,于是你的 Student 类是不是 public 的呢
ZERO1411
2017-04-06 08:37:41 +08:00
@hjc4869 恩恩 不是 public 现在好了 谢谢
ZERO1411
2017-04-06 08:37:59 +08:00
@AsherG 不是 现在是了 谢谢
ZERO1411
2017-04-06 08:38:10 +08:00
@andrewpsy 恩 谢谢
ZERO1411
2017-04-06 08:38:45 +08:00
@otakustay en , I get , thank you

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/352639

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX