Regarding to Purpose for .class files in Java
#1
Hello All, I am working on client project and I am trying to understand how .class files work in java and what's their purpose. I found some information online, but I get unsatisfying explanations. As soon as we run the compiler on Interviewbit online and we get the .class file, which is bytecode. Is this machine-readable or not? 

And if not, this is why we need the interpreter for the program to run successfully? Likewise, since the .class record is what could be compared to our .java programs, for what reason would someone be able to run a java program straight away simply by running the .class document utilizing VM and they could have to have the .java record also?
Reply
#2
Yes, it's machine-readable.

The javac command compiles the .java file and converts it to .class.

More about it here: https://docs.oracle.com/javase/7/docs/te...javac.html

An interpreter has nothing to do with this.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Java Course Materials RobertX 6 9,309 Sep 05, 2024, 02:36 am
Last Post: samui
  how can i learn to use Java efficiently Blue_Bon 10 11,128 Feb 26, 2024, 08:41 am
Last Post: RobertX
  Question About the Concept of Abstracts in Java RobertX 4 5,196 Jan 17, 2024, 07:50 am
Last Post: gulshan212
  [Release] OfflineBay v2 - Open source and No more Java dependency techtac 55 326,772 Apr 01, 2022, 13:42 pm
Last Post: UnknownIdot
  What's a good way to host files on a home website NeonPinkQuartz 3 24,035 Jun 17, 2020, 18:22 pm
Last Post: Moe



Users browsing this thread: 1 Guest(s)