Can we compare JIT with inline function? how It works and why we call it compiler, when JVM is combination of Java Interpreter and OS.
The JIT "compiles" bytecode to native machine code which can then be run directly on further calls. In practice, many JVMs (e.g. Hotspot) will JIT-compile the same bytecode multiple times, adapting the optimization settings based on observed performance data (and on new information such as subclasses being loaded which override previously-inlined code).
when JVM is combination of Java Interpreter and OS.
I wouldn't describe a modern JVM that way. In particular, while most JVMs still include an interpreter of some form, the majority of the time that Java code is running, it isn't being interpreted in the traditional sense.
See more on this question at Stackoverflow