如何在一个班级中调用一个班级.CS

编程入门 行业动态 更新时间:2024-10-24 20:23:41
本文介绍了如何在一个班级中调用一个班级.CS-CS#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我创建一个类名称PersonalInfo.CS.我想将此类称为另一个类,例如EmplInfoc.​​cs

I create one class name PersonalInfo.CS. i want to call this class to another class like EmplInfoc.cs

推荐答案

//Creating object to the class ClassName obj = new ClassName (); //accessing function inside the ClassName obj.GenerateTable("select * from table");

相同的问题 [ ^ ]之前有人问过. 他是您的朋友还是同事? The same question[^] was asked by another person before. Is he your friend or colleague?

重新发布问题的答案 --- 您需要在EmplInfoc中创建PersonalInfo的实例,您可以使用new关键字来实现.例如 Reposted answer to the reposted question --- you need to create an instance of PersonalInfo in your EmplInfoc you do that by using the new keyword. E.g. PersonalInfo personalInfo = new PersonalInfo(); personalInfo.APublicMethod();

但是,这是非常基础的,因此我认为您在这里不会获得满意的答案,因为对基础的解释要比对几行的解释要多.我建议您去书店找一本书.

This is very basic however, so I don''t feel you will get satisfying answers here as explaining the basics takes a bit more then a few lines of explanation. I suggest you go to a bookstore and find yourself a book.

更多推荐

如何在一个班级中调用一个班级.CS

本文发布于:2023-10-31 05:55:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1545207.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:班级   如何在   CS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!