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 even its operating system. If it's well written, any 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, such as the P/Invoke feature, available from .NET in Win32 platforms. This is an example of a machine-independent C# application: it would open ".\data.xml" in Windows and "./data.xml" in Linux (it also prints the resulting path).
  using System;  using System.IO;    namespace Test  {      class TestApp      {          public static void Main(string[] args)          {              string filePath = "." + Path.DirectorySeparatorChar + "data.xml";              Console.WriteLine("The file path is: {0}", filePath);              using(Stream fileData = File.Open())              {                  // Do anything with the file (for example, process it using System.Xml)                  // and don't worry about closing the stream because the using statesment                  // will do it for you (although you could use try-catch-finally)              }          }      }  } 

 

<< PreviousWord BrowserNext >>
uxbridge (disambiguation)
levitation
traffic psychology
barney ewell
rosenborg castle
royal league
israel's unilateral disengagement plan of 2004
dk pattammal
laila harr
leo ii
simon bisley
f.c. lyn oslo
list of lashing knots
square lashing
paphos
plum headed parakeet
popstars live
blossom headed parakeet
ron reagan
1849 in architecture
warringah
marilyn waring
1951 in architecture
semmangudi
saunders roe sr.53
saunders roe sr.177
french river (ontario)
stealers wheel
uss reliant
1764 in architecture
list of wing commander characters
1757 in architecture
peter warren (radio)
peter warren (admiral)
1752 in architecture
1753 in architecture
warren on the weekend
1781 in architecture
wing commander technology and vehicles
1806 in architecture
1795 in architecture
saint sauveur de montagut
loksatta
north adams