Comic | Night Talk on Hard Disk of Java Kid and C Old Man

More exciting technical comics , all in the programmers stand up

Postscript: Portability is what Java prides itself on. It is written once and runs everywhere, but the C language was also known for portability when it was born, but this portability is the portability of the code, not the program Portability, for example, hello.c can be compiled and run on Windows or Linux, without modifying the code at all. Of course, hello.c is just a very simple program. Like Windows and Linux, it has its compiler and standard library. It can definitely be transplanted. If the system platform interface is used, it will be difficult to handle. Write a set of codes for each platform, and then use conditional compilation to do it. 

The C language was born to do system-level programming. It is to be close to the hardware and pursue performance and efficiency. Therefore, there cannot be an abstraction layer such as a virtual machine. It runs on a virtual machine and is very friendly to programmers to write code, but it wants to operate the bottom layer. Need to use technology like JNI, it is also very troublesome.

In order to form an executable file that runs directly on the machine, C language needs a linking process, while Java class files can be linked at runtime, so as long as they can be passed during compilation.

Guess you like

Origin blog.csdn.net/coderising/article/details/110944255