Trent Boult
Trent Boult

Reputation: 117

Java program execution (let's not compilcate things)

I want to check if what I've learnt about Java basics is correct or not. Kindly correct me where I'm wrong.

When we compile/build a program: An object (.class) file corresponding the the source file is generated.

Now, when we run, this is passed to the JVM. The JVM also loads the necessary library files (the import files at the top) and using these two, it directly runs the program, no intermediate executable file is produced, right?

Upvotes: 0

Views: 67

Answers (2)

ddyer
ddyer

Reputation: 1788

No files are created, but modern JVMs generate native code from the class files rather than interpreting directly from the class files.

Upvotes: 0

lacraig2
lacraig2

Reputation: 655

Yes. I think you have the correct sequence. This is the slightly more complicated system. First it generates a class from the .java file and then it goes through this process.

I hope this helps.

Upvotes: 1

Related Questions