I am the one who knows that I don't know anything.
Abhijeet
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
SCJP, SCWCD.
|Asking Good Questions|
fred rosenberger wrote:First and foremost, the term 'platform independant' is NOT well defined. It means different things to different people, so discussing/arguing whether something IS or ISN'T makes no sense unless you define what YOU mean by it.
And yes, you can run a .exe without a compiler. However, you cannot CREATE an .exe without a compiler (and linker).
I am the one who knows that I don't know anything.
Abhijeet
Amit Ghorpade wrote:In continuation to what fred said, Java is "compile once, run anywhere" which is not true for C and C++.
Its not only OS dependent,but at times its also hardware dependent so something build for Intel hardware might not work on AMD.
I am the one who knows that I don't know anything.
Abhijeet
"Known is a drop , unknown is an ocean " !
vamsi acharya wrote:From what i have learned C has been a big hit for its portability in their contemporary world ........then what does that mean ???
![]()
Joanne
Joanne Neal wrote:
vamsi acharya wrote:From what i have learned C has been a big hit for its portability in their contemporary world ........then what does that mean ???
![]()
This means you could compile some source code into an executable using a Windows X86 compiler and run it successfully on a Windows X86 machine.
You could then compile the same source code into an executable using a Solaris/Sparc compiler and run that executable on a Solaris/Sparc machine.
However, the Windows/X86 executable will not run on the Solaris/Sparc machine and the Solaris/Sparc executable will not run on the Windows/X86 machine.
ie. it is the source code that is portable, not the executables. Having said that however, once you get into stuff like networking, C code becomes a lot less portable (without the use of a lot of #ifdefs).
With Java, you can compile the source code into class files and then those class files can be run on any machine with a JVM. You would not need a different version of the class files for each machine type.
"Known is a drop , unknown is an ocean " !
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
1) Write code in C language
2) compile into code for a specific OS version
3) run that code on that machine.
1) write code in java
2) convert to bytecode - Java's own special language - these are class files
3) convert bytecode to machine's native language - this has to be done for each and every OS you want you program to run on
4) run that native language code
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
"Known is a drop , unknown is an ocean " !
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |