在C#中,我们进行了多个公共类,但是在Java中,为什么我们不能进行2次公共类 [英] in c# we make more than one public class but in java why we can not make 2 public class

查看:74
本文介绍了在C#中,我们进行了多个公共类,但是在Java中,为什么我们不能进行2次公共类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在c#中,我们制作了多个公共类,但是在java中,为什么我们不能将2个公共类设为

in c# we make more than one public class but in java why we can not make 2 public class

推荐答案

这不是一个正确的问题,因为您已经暗示您在为什么"下的陈述是正确的.实际上,它要么是胡言乱语( http://en.wikipedia.org/wiki/胡言乱语 [ ^ ])或正式撒谎.

在Java中创建类(公开或不公开)的可能性与"C#"中的可能性几乎相同(您应该说".NET"). :-)

—SA
This is not a correct question, because you already imply that your statement under you "why" is true. In fact, it is either gibberish (http://en.wikipedia.org/wiki/Gibberish[^]) or plain lie, formally speaking.

The possibilities of creating classes (public or not) in Java are nearly the same as in "C#" (you should have said ".NET"). :-)

—SA


您是指部分类吗?同样在C#中,只能有一个类.
只是可以使用此关键字将该类物理地拆分为多个文件-尽管从逻辑上讲它仍是一个文件.
Do you mean partial classes? In C# too, there can only be one class.
Its just that this class can be split physically into multiple files using this keyword - though logically its just still one file.


您可以根据需要创建尽可能多的公共类,并使用所有语言我曾经从事过.谁说你不能?或者,您的意思是在单个源文件中-谁知道?
You can make as many public classes as you like, in all languages that I have ever worked on. Who said you couldn''t? Or perhaps you mean in a single source file - who knows?


这篇关于在C#中,我们进行了多个公共类,但是在Java中,为什么我们不能进行2次公共类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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