Question: i know that java programs are first compiled and a bytecode is generated which is platform independent. But my question is why is this bytecode interpreted in the next stage and not compiled even though compilation is faster than interpretation in general??

Answer: 
The Java bytecode normally *is* compiled via [Just-In-Time (JIT) compilation](http://en.wikipedia.org/wiki/Just-in-time_compilation).

So you still end up with fully compiled native code being executed, the only difference is that this native code is generated by the JVM at runtime, rather than being statically generated at the time the source code is compiled (as would happen with C/C++).

This gives Java two big advantages:

* By delaying the compilation until runtime, the bytecode remains fully portable across platforms
* In some cases the JIT compiler can actually generate more optimised native code because it is able to exploit statistics gathered by examining the execution parths of the code at runtime.

The downside, of course, is that the JIT compiler needs to do it's work at application start-up, which explains why JVM applications can have a slightly long start-up time compared to natively compiled apps.
Byte code is platform independent. Once compiled into bytecode, it could run on any system.

As it says on Wikipedia, 

> 
> [`Just-in-time compilation (JIT)`](http://en.wikipedia.org/wiki/Just-in-time_compilation), also known as dynamic translation, is
>  a method to improve the runtime performance of computer programs. 
> 
> 
> 

I recommend you to read this article. Its gives the [`basic working of JIT compiler`](http://www.javacommerce.com/displaypage.jsp?name=jit_compiler.sql&id=18268) for Java VM. 

> 
> JIT compilers alter the role of the VM a little by directly compiling
>  Java bytecode into native platform code, thereby relieving the VM of
>  its need to manually call underlying native system services. The
>  purpose of JIT compilers, however, isn't to allow the VM to relax. By
>  compiling bytecodes into native code, execution speed can be greatly
>  improved because the native code can be executed directly on the
>  underlying platform.
> 
> 
> When JIT compiler is installed, instead of the VM calling the
>  underlying native operating system, it calls the JIT compiler. The JIT
>  compiler in turn generates native code that can be passed on to the
>  native operating system for execution. The primary benefit of this
>  arrangement is that the JIT compiler is completely transparent to
>  everything except the VM.
> 
> 
>