Comparison of other IOS languages-Comparison Between Objc and JAVA, ios-objc
1. Objc is a compilation language and JAVA is a parsing language.
Compile-type language: compile all the source programs into executable programs with binary code. Then, you can run the program directly. Compiled language, fast execution speed and high efficiency; less dependent on compiler and cross-platform performance.
Parsing language: An interpreted language is translated only when the program is running. Each statement is translated only when execution is performed. In this way, each execution of an explanatory language requires a translation, which is less efficient. Interpreted language, which is slow in execution and low in efficiency. It depends on the interpreter and has good cross-platform performance.
Objc is a dynamic language, that is, it can change the code structure at runtime, while Java is a static language. KVC and KVO in Objc fully demonstrate this feature.
2. Memory Management and message transmission:
Objc is the reference count, which occurs during the compilation period. Java is garbage collection, which occurs at runtime. Later, the Objc came into being with the ARC, where programmers were not required to write memory management. However, the essence of Objc was the memory management based on reference count during compilation.
The biggest difference is that Objc uses message transmission, which is essentially a string, so it can modify classes, objects, and methods at runtime. The Java method is statically bound to the class. Although it is obtained through reflection at runtime, the performance will decrease by an order of magnitude. So Objc is more dynamic.
Why is the android mobile phone experience a little poor, Because Java's garbage collection mechanism.
3. Code:
1) Java has a namespace package and Ojbc does not.
2) different methods are used to implement multi-inheritance. java cannot inherit multiple parent classes and can implement multi-inheritance by implementing multiple interface interfaces. Objc implements Multi-inheritance through Categories and Protocols.