Opentopia Directory Encyclopedia Tools

Machine-independent

Encyclopedia : M : MA : MAC : Machine-independent



 

In Computer science, a machine-independent program is any program that can be run by any computer, without regard to its architecture or operating system.

Any well-written Java or .NET application could be machine-independent because these platforms run on virtual machines on top of the real computer. The real machine-dependent part is the virtual machine, so this is the (usually little compared to the class libraries) chunk of code that needs to be ported.

To be machine-independent, the application also must not use any machine or platform-specific resources available. Examples of platform specific features are .NET P/Invoke and Java Native Interface, both of which allow the direct use of native libraries.

This is an example of a machine-independent C# application: it would open ".\data.xml" in Microsoft Windows and "./data.xml" in Linux (it also prints the resulting path).

using System;
using System.IO;

namespace Test ", filePath); using(Stream fileData = File.Open()) } } }

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.


Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: