我需要帮助 ;我必须写二进制读取和写入列表; [英] I Need Help ; I Have To Write Binary Read And Write From List;

查看:78
本文介绍了我需要帮助 ;我必须写二进制读取和写入列表;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有Person类,其中有Public List< person> list {get;组;有人可以写这段代码吗?谢谢;)))

we have Person class where have Public List<person> list { get; set; } Can someone write this code? thank you ;)))

推荐答案

OK:

OK:
public List<person> List { get; set; }



除此之外,直接公开集合是一个坏主意,它可以使用类构造函数中的任何一个代码来默认创建一个空列表,或者支持字段而不是使用自动属性。我也将私人定位器。



其余由你决定:这是你的功课,我们不做你的功课 - 这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



所以自己尝试一下,你可能会发现它是并不像你想象的那么困难!


Other than that, it's a bad idea to expose a collection directly, and it could use either code in the class constructor to create an empty list by default, or a backing field rather than using an automatic property. I'd also make the setter private.

The rest is up to you: it's your homework, and we do not do your homework - it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

So try it yourself, you may find it is not as difficult as you think!


这篇关于我需要帮助 ;我必须写二进制读取和写入列表;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆