How fast are Java programs compared to equivalent C or C++ programs?
Ans : The relative speed depends on the type of program and on whether the virtual machine implementation uses interpretation or just-in-time compilationGUI-intensive programs may have little noticeable difference, but computation-intensive programs run about 10-20 times slower in interpreted Java Virtual Machine instructions than in compiled native code. The execution speed of a Java program depends on how you run it. Most of the initial Java Virtual Machine implementations run interpretivelythey translate Java Virtual Machine instructions to native machine code each time immediately prior to executing the code. Common estimates are that an interpretive virtual machine implementation runs around 10-20 times slower than comparable code compiled directly to the native platform. This slowdown represents the worst-case behavior for computation-bound programs, where intensive, uninterrupted computation comprises most or all of the program. GUI-dominated programs, on the other hand, typical