In Java not just the source but also the compiled bytecode is the same across all platforms. You can take compiled Java code and run it on any JVM on any system.
Now i'm annoyed. as i typed my answer in your other thread, Marc answered it in this thread. so, either he or I have now wasted our time givng the same answer to the same question.
I have deleted your other copy of the thread.
Never ascribe to malice that which can be adequately explained by stupidity.
no, you cannot. when you compile your C/C++ code, you change it into machine language. that language is native to a specific CPU.
Think of it this way... each kind of computer speaks it's own language. French, German, Italian, Farsi, Chinese... whatever.
the C/C++ way: Think of my source code as English. I write the document in English (as I am a native English speaker). If i want to sent that document to each country, I have to translate it into each of those languages. I have to send the French one to France, the Chinese one to China, etc.
The Java way: Now with java, it's a little different. the find folks at SUN computing have sent an interpreter to each country. I can now write my document in English, and send the EXACT same document to everywhere in the world. the interpreter in each country picks up the document, and they translate it into the local language. [ November 13, 2007: Message edited by: Fred Rosenberger ]
pras
Ranch Hand
Joined: Apr 04, 2007
Posts: 188
posted
0
Hi sir,
when people say its platform independent are they reffering to the hardware architecture or the operating system?
When you run your Java program, the JVM executes the compiled bytecode. It does not use the source code of your program. There are no tokens and lines in the bytecode. Bytecode looks like machine code instructions. [ November 14, 2007: Message edited by: Jesper Young ]