Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


In C we use only compiler. Why java uses both compiler and
interpreter? What is its significance?

Answers were Sorted based on User's Feedback



In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?..

Answer / nidhi,himani

because in java, code is 1st converted into bytecode by the
compiler nd then it is converted into machine code by the
interpreter.

Is This Answer Correct ?    29 Yes 8 No

In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?..

Answer / kuldeep sharma

Java is Platform Independent language it uses Virtual
System (JVM) in an existing operating system to run
programs.
The JVM itself is not Platform independent it is platform
dependent. but its functionality is same for all verison of
JVM for different OSs.

The Source Code of a Java Program is compiled to avail the
advantages of compiler like fast development, i mean all
the errors are checked and displayed by the compiler at once
(in 99.99% cases) to make the code error free.

An error free Java Code is converted into BYTECODE ;
directly understood by the JVM(for all OSs).

Now consider we compiled a.java >> a.class on linux, the
a.class is portable and runnable on other OS like Windows
because class files are fun by JVM but not by the OSs that
why we can say
Java is platform Independent.

Is This Answer Correct ?    12 Yes 4 No

In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?..

Answer / rinky

If a source code is written in C,then after compilation platform dependent native code is generated which is specific to the platform and whenever if you want to execute the same source code into different platform you have to recompile the program which is wastage of time.
srcprogram-->compile-->platform1---->platform native code
srcprogram-->compile-->platform2-->platform2 native code
But coming to Java,when you compile your source code ,an intermediate code is generated(.class file)which is common to all the platforms and you can execute the .class file on any platform with the help of jvm to generate native code of the specific platform.

src prg(.javafile)-->compile(on any platform Xplatform)-->bytecode(.classfile)-->jvm(execute on)-->platform(p1 or p2...or pn)(to get native code)
that is what java's passion compile once run anywhere

Is This Answer Correct ?    7 Yes 3 No

In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?..

Answer / dhana

in java code is complied by the complier at that time code
is convered into byte code after that JVM can convert the
byte code instructions into Machine code instructions.

Is This Answer Correct ?    10 Yes 8 No

In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?..

Answer / ershad md sk

In C Lang Our program is directly Converted into
Executable code which is a Not portable..& it is Machine
Specific..in JAVA first .class file is Converted into .java
File And the Interpreter wil generate a intermediate Code
that is BYTE CODE..Which is Machine Independent...it has 0%
protability Issue............

Is This Answer Correct ?    3 Yes 9 No

Post New Answer

More Core Java Interview Questions

How are commas used in the initialization and iteration parts of a for statement?

2 Answers  


Where and how can you use a private constructor?

0 Answers  


What are locale settings?

0 Answers  


Write a function for palindrome and factorial and explain?

0 Answers   Honeywell, Huawei, Zomato,


In what type of containers, Border layout is a default layout?

3 Answers  


Is vector ordered in java?

0 Answers  


How does the java compiler work?

0 Answers  


What is the biggest integer?

0 Answers  


Can private method static?

0 Answers  


I declared main() method as private. But it still running and displaying the output. Please Answer it . Code Snippet as Below: import java.io.*; class over { private static void main(String[] args) { int high = Integer.MAX_VALUE; int overflow = high + 1; int low = Integer.MIN_VALUE; int underflow = low - 1; System.out.println(high + "\n" +overflow +"\n"+ low +"\n"+underflow); //System.out.println(overflow); //System.out.println(low); //System.out.println(underflow); } }

4 Answers   Cap Gemini,


How do you use, call, and access a static method in Java?

2 Answers  


Can a abstract class be declared final?

0 Answers  


Categories