1. The inline function means that the function is directly expanded where it is called, and the compiler does not need to be used as a general function, the parameters are stacked, the parameters are pushed back and the resource is released, etc., which improves the program execution speed.
There is a keyword final in the 2.Java language to indicate that the function is inline, for example:
Public final void DoSomething () {
To do something
}
When called, the method will be used directly at the call, thus increasing the execution speed of the program. In addition, the final keyword has a role to prevent dosomething methods from being overwritten in subclasses, and if you want DoSomething to be a final act, it should be designed as final.
Inline is not necessarily good, when the method body that is specified as an inline is large, the overhead of the expansion may have exceeded the time of the normal function call, and the introduction of the inline has reduced performance because it should be prudent to select this keyword, but in later versions of the JVM the optimizations were made when the inline was processed. It determines whether the call is expanded based on the size of the method.
Java inline functions