+ 5
Help me out please...?
I recently came across the concept that how our codes are processed by the computer. which is that first our code is compiled by compiler into machine language i.e 0s and 1s that computer can read. so my doubt is... does that mean two same codes ( i.e they perform same task ) in different languages e.g one in java and other in C++ or else , are they same once compiled for same computer in 0s and 1s....?
6 Respostas
+ 5
This question had come to my mind a while ago but later I realized that Ways to work both are completely different
+ 2
No they are not same
For example, Java compiles its code to a byte code which is interpreted by its compiler
+ 2
shakir I'm aware of that my question is after it is compiled what then shouldn't it be same as it has to do the same task but now just in 0 1 form
+ 2
nope
java compiles its code for java virtual machine to parse, so to execute it you need jvm
c++ converts the code into assembly language then links appropriate functions and libraries to the executable file
as the assembly code for each architecture are different, you will have to compile c++ code for each architecture separately
whereas,
to run java executable, all you have to do is install jvm and execute the file
+ 2
Thanks a lot for all of your help
+ 1
Yes, Sreejith is right