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 6,228 Mar 20, 2024, 23:54 pm
Last Post: stp99
  how can i learn to use Java efficiently Blue_Bon 10 7,689 Feb 26, 2024, 08:41 am
Last Post: RobertX
  Question About the Concept of Abstracts in Java RobertX 4 3,338 Jan 17, 2024, 07:50 am
Last Post: gulshan212
  [Release] OfflineBay v2 - Open source and No more Java dependency techtac 55 319,077 Apr 01, 2022, 13:42 pm
Last Post: UnknownIdot
  What's a good way to host files on a home website NeonPinkQuartz 3 23,017 Jun 17, 2020, 18:22 pm
Last Post: Moe



Users browsing this thread: 1 Guest(s)