Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: James Rivera   on Jul 31 In Java Category.

  
Question Answered By: Jackson Williams   on Jul 31

when u compile a java program it will create the code which JVM(Java Virtual
Machine) can understand & execute.
.class files are in the form of Byte code.

but if u r compiling a .c program & .cpp program the compiler will create the
.obj & .exe files. in my belief .exe is in machine code which can executed by
the operating system itself only where it was compiled. you can't execute the
same .exe file in diff o/s.

for example u can't compile a program in dos/windows O/S and u can't run in
Linux/ Solaris platform. becoz the compiled code was O/S oriented.

but Java programs are compiled for the JVM not for OS, so if there is an
compatible JVM in any OS u can run the same .class file. (with certain
restrictions., like filesystem, filehandling, etc.,) JVM will take care of OS
calls.

.NET compilers also has new idea of CLR(Common Language Runtime), like JVM it
compiles more than one language and create code for the CLR, so u can compile
multiple languages and make a same code, for ex u can compile COBOL,C++,C#
programs for CLR & run it through .NET framework.

all these things are just my beliefs only, if anything is wrong plz let me
know...

Share: 

 

This Question has 28 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Why we declare the constructor private? Or get search suggestion and latest updates.


Tagged: