Java Interpreted Language

kumar's picture

HI all,
We all know that Java interpreted Language because of the bytecode and JVM is its interpreter .
So at the time of the C ,c++ interpretion was not considered good because of reasons like interpretation takes time.But Java and later languages like c#,JS are all interpreted ..why is that ,what may be the reason for this?
Thanks in advance.

nik_m's picture

A major problem with C/C++

A major problem with C/C++ then was portability. Due to diversity of OS, it was not efficient to
rewrite code for different platforms. JVM/.Net provides a single platform such that code can run on any OS
without having to rewrite it. Although it caused performance issues, it provided a efficient solution by reducing cost ,
code duplication and time.

mukund's picture

Hi nik_m, I think you got the

Hi nik_m, I think you got the question wrong....the question is "!n early days of c,c++ in which compiled programs were considered to be faster than interpreted programs but with the coming of languages like Java , .NET which are interpreted languages..why is the performance much better.."

I think in Java and .NET we still compile the programs though not directly into machine instructions as in compiled languages.We first compile it to intermediate code and then you interpret it.During interpretation JIT is used to speed up execution of intermediate code.This interpreter is different for different platforms(Windows,Linux,Mac) whereas earlier the interpreted languages did not have this Intermediate code they used to interpret it line by line and if loops are there then even more time(because of multiple execution).So the present days interpreted languages are faster than the likes of BASIC and Smalltalk.
Hi Raj,
Read this it might give you a better answer.
http://en.wikipedia.org/wiki/Just-in-time_compilation
I hope this helps.

kumar's picture

thanks!

thanks!

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
Thank you for using Captcha to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.