1

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

5 Answers 5

5

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.

Sign up to request clarification or add additional context in comments.

4 Comments

exe is not restricted to windows
Student can also be a file.
depends on what you mean, binary file usually refers to a file that contains machine instructions. class files certainly do not
binary file to me (especially right after a sentence referring to text files) means a non-text file. PNG and GIF are binary files.
0

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.

Comments

0

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.

Comments

0

Student.class is Java bytecode.

Student.java has java source code

Student not a file at all,

Student.exe is a Windows executable file

Comments

0

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.