+ 2
Java is said to be platform independent because of its byte code which runs on any os only by class file without source code??
I made some changes knowingly in a class file of a java program but when I recompile it and ran it it gave me an error which meant that source file is verified with class file then how come program can run in Ubuntu Linux only with class file if it needs to be verify the class file and source file of a program?? its like how a developers give it's software to user without giving it's source code????
3 Respuestas
+ 2
If it is open source, you can find the source code, probably in the developer's website. If it is propreitary, you can't access it
+ 1
Well the byte code is basically the compiled version of your program which JVM (Java Virtual Machine) can execute.
The fact that it's the JVM of the particular OS which changes the byte code to machine code, makes Java portable.
Also, note that if an OS doesn't yet have a version of JVM installed (or created) on it, the byte code won't run.
0
Thank u that makes some sense 👍👍👍