Java – exactly the meaning of “portability”

cjavaterminology

I know very well that java is a portable language..and it is the byte-code that makes it portable..

However I've studied also that C is a portable language.
"The programs written in C are portable i.e. programs written for one type of computer or operating system can be run on another type of computer or operating system."

Then what is the difference between C portability and Java's portability?
can we say that C is also a portable language like java?
I know that java portability may be in terms of different application such as mac, PC, mobile phone..and C can't be used in such cases..But my question is still as how portability is different in both language?

Please clear my confusion.
Thanks in advance..

Best Answer

Java is object-compatible. You compile it on one patform and the resultant class files can run on any JVM.

C is source-portable. You can take your C source code and compile it on any ISO C compiler, provided you follow the rules - that means no using undefined or implementation defined behaviour or any non-standard features.