C#编译器编译.txt .obj .java文件

编程入门 行业动态 更新时间:2024-10-16 00:23:02
本文介绍了C#编译器编译.txt .obj .java文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 using System; class Program { public static void Main() { Console.WriteLine("Hello World!"); Console.ReadLine(); } }

我将文件另存为 1.java , 2.obj 和 3.txt 。 然后我使用Visual Studio命令提示符来编译文件: csc 1.java csc 2.obj csc 3.txt

I save the file as 1.java, 2.obj and 3.txt. I then use the Visual Studio Command Prompt to compile the file: csc 1.java csc 2.obj csc 3.txt

令人惊讶的是,它将所有3个文件编译为可执行文件并成功执行。

Surprisingly, it compiles all the 3 files into an executable and executes it successfully.

有人可以给我对此行为的解释吗?

Could anyone give me an explanation on this behavior?

推荐答案

开始的C#对象:从概念到代码-Jacquie Ba rker,格兰特·帕尔默(Grant Palmer)

建议的约定是使用扩展名.cs结束源代码文件名,但是没有必要这样做;可以想象,源文件可以命名为Person.boo,例如

The recommended convention is to end source code file names with the extension .cs, but there is no requirement to do so; a source file could conceivably be named Person.boo, for example

也可以从同一本书。

类似地,C#源文件的名称不必与内部定义的类或接口的名称匹配。该文件。例如,可以将定义Professor类的代码放在名为 Blah.cs的文件中,但是将源文件名匹配为的源文件名与该类的名称或在文件内声明的接口。

Similarly, the name of a C# source file doesn't have to match the name of the class or interface defined within that file. For example, the code defining the Professor class could be placed in a file named Blah.cs, but it's considered good practice for a source file name to match the name of the class or interface declared within the file.

更多推荐

C#编译器编译.txt .obj .java文件

本文发布于:2023-11-13 22:31:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585505.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:编译器   文件   obj   txt   java

发布评论

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

>www.elefans.com

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