Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Java produce object code or byte code?

Tags:

java

It's my understanding that the Java compiler produces "byte code", not "object code". First of all, is this correct?

Also, that's just what my book says, I was wondering why this is correct. What is the difference between byte code and object code?

like image 410
Bhaxy Avatar asked Jan 19 '12 22:01

Bhaxy


Video Answer


2 Answers

Byte code is just the "object code" for the Java Virtual Machine. It's not native code (e.g. x86). To be honest, I rarely hear the term "object code" these days - it's generally clearer to talk in more specific terms.

like image 149
Jon Skeet Avatar answered Oct 27 '22 03:10

Jon Skeet


When you compile a java program, it goes to byte-code. When you run the resulting artifact, the JVM of the platform then runs (well, interprets) the bytecode, turning it into machine level instructions.

like image 41
hvgotcodes Avatar answered Oct 27 '22 05:10

hvgotcodes