+ 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....?

22nd May 2018, 4:51 AM
Madhav
Madhav - avatar
6 odpowiedzi
+ 5
This question had come to my mind a while ago but later I realized that Ways to work both are completely different
23rd May 2018, 10:42 AM
🇨 🇭 🇭 🇦 🇹 🇷 🇦 🇵 🇦 🇱
🇨 🇭 🇭 🇦 🇹 🇷 🇦 🇵 🇦 🇱 - avatar
+ 2
No they are not same For example, Java compiles its code to a byte code which is interpreted by its compiler
22nd May 2018, 4:57 AM
Shakir Dodhiya
Shakir Dodhiya - avatar
+ 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
22nd May 2018, 5:35 AM
Madhav
Madhav - avatar
+ 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
22nd May 2018, 8:43 AM
‎ ‏‏‎Anonymous Guy
+ 2
Thanks a lot for all of your help
22nd May 2018, 1:17 PM
Madhav
Madhav - avatar
+ 1
Yes, Sreejith is right
22nd May 2018, 1:05 PM
Shakir Dodhiya
Shakir Dodhiya - avatar