3

What is the difference between Machine Independence and Platform Independence Or both are same?

Ankur Lathi
  • 7,636
  • 5
  • 37
  • 49
  • Side note: providing *your* definition of each could make answering more concrete... – Alexei Levenkov Jul 17 '13 at 04:44
  • I know java is Platform Independent but I am asking the difference between the terms Machine Independence and Platform Independence. Does both are same? – Ankur Lathi Jul 17 '13 at 08:21
  • 1
    Machine Dependence: This means that whatever you want to execute on your hardware architecture will not be able to execute on another architecture. Like If you have created an executable for your AMD architecture it will not be able to run on Intel's architecture. Now comes Platform Dependence is that you have created some executable for your Windows OS which won't be able to run on Linux.Code written in Assembly(provided by your processor) or Machine Language are machine dependent but if you write code in C,CPP,JAVA then your code is machine independent which is provided by underlying OS – Ajay Bhojak Jul 18 '13 at 07:38
  • 1
    Platform Independence:If you create some C or CPP code then it becomes platform dependent because it produces an intermediate file i.e. compiled file which matches to the instruction set provided by underlying OS. So you need some mediator which can understand both compiler and OS.Java achieved this by creating JVM. Note: No language is machine independent if you remove the OS which itself is a program created using some language which can directly talk to your underlying machine architecture. OS is such a program which takes your compiled code and run it ontop of the underlying architecture. – Ajay Bhojak Jul 18 '13 at 08:54

0 Answers0