1. The inline function means that the function is directly expanded where it is called, and the compiler does not need to use the same function as the normal functions, the reference stack, the return of the stack and the release of resources, and so on, which improves the program running speed.
There is a keywordfinal in the 2.Java language to indicate that the function is inline, for example:
Public final void DoSomething () {
To do something
}
This method is used when it is invoked. is used directly at the call, which increases the speed of the program.
In addition Finalkeyword is another function that prevents the DoSomething method from being overwritten in subclasses. Suppose you want dosomething to be a last act. Then it should be designed as final.
Inline is not necessarily good. When the method body that is specified as inline is very large, the overhead of the expansion may have exceeded the time that the normal function call was called. The introduction of inline instead reduces performance, since it should be prudent to choose this keyword, except that in later versions of the JVM, optimizations are made when dealing with inline, depending on the size of the method to determine whether the call is expanded.
Java inline functions