接口和类抽象 [英] Interface and Class Abstrac

查看:55
本文介绍了接口和类抽象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在大学时遇到这个问题,我需要使用接口和抽象类.
我有一个与该字段有关的班级>姓名,出生日期,国家/地区,不久的日子,妻子的名字.

另外,我需要制作安全问题狐狸示例:
第一种形式向我询问人名,第二种形式向我显示3个不同的安全问题和5个答案,答案可以是国家/地区,生日等.
因此,我将有问题类抽象的答案,其他类有答案.因此,该程序应随时准备投放任何课堂和答案.

请问我该怎么做,对不起我的英语,我来自秘鲁.

请给我发送电子邮件副本到DELETED@hotmail.com

非常感谢.

已删除电子邮件[/编辑]

Hi,

I have this problem in my university I need use interface and abstract class.
I have a class person with this fields> name, datebirth, country, number of soons, name of wife.

Plus I need make security question fox example:
The first form ask me about the name of the person , in the next form show me 3 different security question and 5 answers the answers can be country, datebirth, etc.
So I going to have question class abstract, other class for answer. So the program nee be prepare to ad anything class and answer.

how can i do this please, sorry my English I am from Peru.

Please send me email copy to DELETED@hotmail.com

Thanks so much.

Removed Email[/Edit]

推荐答案

很显然,您在这里需要做的是研究并了解什么是接口和抽象类,以及它们是什么.是为C#和.NET设计的,以及如何最好地使用它们.

在CodeProject上,您可以找到直接比较接口与抽象类的使用的几篇文章/教程:我建议您从这里开始:[
您需要清楚自己的想法:在项目实现的解决方案中,需要使用抽象类的什么;需要使用界面的内容.如果可以使用抽象类或接口,那么您应该能够理解在项目上下文中哪个是更好的选择.

然后,您需要对一些代码进行原型设计,并进行初始实现.然后,您可以在此处发布问题,从代码中给出具体示例,并提出具体问题;我敢肯定,这些特定的问题可以而且肯定会得到在QA上提供帮助的许多技术精湛的专家的慷慨解答.
Clearly what you need to do here is study and learn what interfaces and abstract classes "are," and what they are designed for, and how they are best used, in C#, and .NET.

Here on CodeProject you can find several articles/tutorials directly comparing the use of Interfaces with Abstract Classes: I suggest you start here: [^].

And, there are many excellent tutorials on the web, and on MSDN. Just Google !

No one here is going to do your homework for you. What you present here is too vague, and confused, to start an "answer" to this not-a-question. You kind of imply some kind of "wizard-like" ui that moves from one screen to another, you kind of imply this is some kind of elaborate security clearance system, but it''s all too fuzzy to really visualize, at least for me.

You need to get clear in your mind: what, in the solution your project implements, requires that you use an abstract class; what requires you use an interface. If it''s the case that you could use either an abstract class, or, interface: then you should be able to understand which one is a better choice in the context of your project.

Then you need to prototype some code, and do an initial implementation. Then, you can post questions here, giving specific examples from your code, and asking specific questions; and those specific questions can, and will be, I am sure, generously responded to by the many technically excellent minds that help-out, here, on QA.


这篇关于接口和类抽象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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