文件名与classname不同时的实例化 [英] Instantiation when filename is different from classname

查看:66
本文介绍了文件名与classname不同时的实例化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,老师问一个prg在这里?

展开 | 选择 | Wrap | 行号

解决方案

1)是C / C ++论坛。转到Java,但请注意你发布的地方


2)让类名与文件名不同是不好的做法,我不知道如果有IDE将编译它(我知道NetBeans不会,我不认为Eclipse会,但我不确定),但如果有,你将不得不包括名称该文件,但通过类名实例化它。其中一个Java专家/ mod应该能够详细介绍,或者纠正我。


而且,由于你的其他线程中已经请求过弱点,请阅读这个非常谨慎,我们不想采取行动反对你没跟随他们。



大家好我的老师问一个prg在这里吗?

展开 | 选择 | Wrap | 行号


..编译的.class文件的名称是什么?


...



如果有的话


hi everyone my teacher ask bout one prg is here?

Expand|Select|Wrap|Line Numbers

解决方案

1) This is the C/C++ forum. Moving to Java, but please be careful of where you post

2) It''s bad practice to have the class name different from the file name, and I don''t know if there are IDEs out there that will compile it (I know NetBeans won''t, and I don''t think Eclipse will, but I''m not sure), but if there are, you would have to include the name of the file, but instantiate it through the class name. One of the Java experts/mods should be able to go into more detail, or correct me on this.

And, as weaknessforcats already requested in your other thread, please read this very carefully, we don''t want to have to take action against you for not following them.


hi everyone my teacher ask bout one prg is here?

Expand|Select|Wrap|Line Numbers


..What is the name of the compiled .class file?

...

If any


这篇关于文件名与classname不同时的实例化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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