1. In terms of operation mode:
C language: The original C is process-oriented, that is, executed line by line.
JAVA: Absolutely object-oriented and executed by module.
(Supplement: Of course, in C and C#, C has also converted to object-oriented mode)
2. In terms of usage
C language : Pure C is generally used in embedded systems to write the lowest-level programs, because its language is the easiest to connect to the hardware. Can do: embedded low-level software, operating system, various function libraries, engine library software core code, server-side low-level tools.
JAVA: J2EE, J2SM, J2ME, anything. What you can do: Embedded mobile device application software development, web page background logic development, some desktop programs
C, JAVA can actually be used in various fields.
3. The syntax is different:
● C language can directly operate memory, but java cannot directly operate it;
● C language can encapsulate dynamic libraries, but java cannot;
● C Language code is not easy to cross-platform, and Java code is easy to cross-platform;
● C language has pointers, java does not have pointers;
● C language can directly operate the serial port, while java requires a third-party jar Package support;
● C language threads are more flexible, and Java threads have been encapsulated;
● The identifiers available in C are numbers, uppercase and lowercase letters, and underscores, but not numbers. Beginning; In addition to the three types of identifiers available in C, Java has one more dollar sign ($), which also cannot start with a number.
4. Other differences
● The compilation time of a single file java is faster than C language;
●java is written in C language;
● When JAVA is used for web development, there are already many established framework technologies, there is very little C language, and the underlying content needs to be processed, which is very difficult for developers who are not familiar with computer principles;
● There are too many open source packages for JAVA, but there are too few for C language, and there are not as many frameworks for certain business application fields as Java;
● JAVA can be cross-platform, but C language cannot.
The above is the detailed content of What is the difference between Java and C language. For more information, please follow other related articles on the PHP Chinese website!