Platform - the machine or OS a program is run on -- like a PC or a MAC..... you could even consider a video game console a platform (XBox, Wii, etc)
The point of the situation is, just because something is portable, doesn't mean it's platform independent. You can take your C or C++ code with you, but unless you bring it somewhere where you're on the same platform it was compiled on, you have no way to run it.
Prash Singh wrote:
But still there is something.
Does by machine you mean which processor is being used?
Thanks in Advance.
Ahhhh..... I have always (in theory) taken "machine" to be a little of both. PC and Linux are 2 separate platforms, but they can be run on the same physical hardware. PC or MAC have different languages, but if you run a "Virtual machine" you can run the other's platform on the same hardware.
I think the real life application of platform is the Operating System.
I think the real life application of machine is the hardware.
A "virtual machine" is an interpreter for the platform so it can understand languages from other platforms/hardware. In essence, it's software that does what hardware and/or the platform can't (or might not be able to).
s.palanivel rajan wrote:its simple ya...
portability is nothing but we can create our java program and compile it in any operaring system..
you do not take your java program around and compile each time on machine of your choice. That is against the spirit of platform independence. You compile a java file on a machine. That generates a byte code (class file). Now that byte code can be taken around and to run on any machine it needs machine dependent runtime environment. (yeah , you saw it write, machine dependent JRE). Independency comes in terms of leveraging once compiled byte code.