Compiled languages such as C: After the program is developed in C, the program needs to be compiled into machine language by the compiler (i.e., computer-recognized binaries, because the binary files identified by different operating system computers are different), so the C-language program will be re-compiled after porting.
For explanatory languages, such as the Java language, Java programs are first compiled into class files by compilers, and are interpreted by Java Virtual Machines (VMS) on the Windows platform if they are run on the Windows platform. If running on a Linux platform, the Java Virtual machine on the Linux platform is interpreted and executed. So you can cross-platform, if the platform must have a matching Java virtual machine. If you do not have a Java virtual machine, you cannot cross-platform.
1 Packagecom.table;2 3 4 classExceptionnum5 {6 voidInputnum (intNumaintNumB)7 {8 Try {9 Ten intNUMC = NumA/NumB; OneSystem.out.println ("Success:" +NUMC); A } - Catch(Exception e) - { theSystem.out.println ("Exception:" +e.getmessage ()); - return; - } - + return; - } + } A at Public classseventeentable { - Public Static voidMain (String []args) - { -Exceptionnum en =Newexceptionnum (); -En.inputnum (1, 0); -En.inputnum (1, 1); in } -}
The compiler language is not as good as the interpretive language cross-platform