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 ]
Joined: Apr 04, 2007
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 ]