简体   繁体   中英

Byte code and Source code in Java?

I'm really confused. Please someone help to give a clear answer of which of the following contain source code and byte code in java?

  1. Student.class
  2. Student
  3. Student.java
  4. Student.exe

Student.java is the Java source code file, a text file

Student.class is the bytecode compiled from it, a binary file

Student.exe is a Windows executable (also binary, but not something you usually get from Java )

Student is not a file at all, just an abstract concept (a Java class, whose full name would be something like com.vicheanak.myapp.Student ).

You may also encounter Student.jar which is an archive of all the class files and other resources that make up the application or library.

Your source code would be Student.java. Bytecode would be Student.class. Source code becomes byte code when you compile it (eg: with javac). Student would be your class name. I'm not sure about Student.exe, it would be your bytecode if you used C/C++ on Windows.

Student.class is Java bytecode.

Student has no meaning - it is probably not a file.

Student.java has java source code.

Student.exe has assembler bytecode.

Student.class is Java bytecode.

Student.java has java source code

Student not a file at all,

Student.exe is a Windows executable file

Student.class is byte code for the java virtual machine. It will execute this directly (or just in time compile it into assembly, which is instructions that the CPU reads directly).

Student is the name of your class, I guess.

Student.java is the source code for your class. It will be compiled into Student.class.

Student.exe is an executable file. It'll be coded to start up the java virtual machine, which will execute the byte code in Student.class (which will most likely be embedded inside it).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM