Skip to main content

Questions

1. What is Source Code?

Human understandable code written using High Level Programming language is called as Source Code.

2. What is Native Code or Binary Code or Machine Code?

Machine understandable code written using Low Level Programming language is called as Native Code.

3. What is Byte Code?

JVM understandable code generated by Java Compiler is called as Byte Code. Byte code is also called as Magic Value.

4. Why C and C++ are Platform Dependent?

When you compile C or C++ program on one Operating System then compiler generates that Operating System understandable native code. This native code generated on one OS will not run on other OS directly.

5. Why Java is Platform Independent?

When you compile Java program on one Operating System then Java compiler generates Byte Code. You can run that Byte code on any OS which has the JVM. JVM is understanding the Byte code and generating native code for the corresponding OS. Because of Byte code and JVM, Java is Platform Independent. Because of Platform Independent, you can use - Write Once Run Anywhere (WORA).

6. I have written one program in C or C++ and another program in Java. Which program will be executed fastly and why?

C or C++ program execution is faster than Java program. Because compiled code of C or C++ program contains binary code and that binary code will be executed directly whereas compiled code of Java program contains byte code and that byte code will be converted to native code first and then native code will be executed.

7. What is Java Compiler?

Java Compiler is a program developed in C or C++ programming language with the name “javac”.

It is responsible for the following tasks:

  • It will check syntactical or grammatical errors of the programs.
  • It converts source code to byte code.

8. What is Java Interpreter?

Java Interpreter is a program developed in C or C++ programming language with the name “java”.

It is responsible for the following tasks:

  • It will convert byte code to native code line by line.
  • It will execute that native code.

Note: Because of converting and executing line by line, Java program execution was slower in initial versions of Java.

9. What is JIT Compiler?

JIT (Just-In-Time) compiler is a component of the Java Runtime Environment. JIT Compiler compiles or translates or converts the necessary part of the bytecode into machine code instead of converting line by line. Because of this, performance of Java program has improved.

10. What is JDK (Java Development Kit) / SDK (Software Development Kit)?

It is a set of various utility programs which are required for developing and executing the Java programs.

It is Platform dependent. Various JDKs are provided for various Operating Systems.

Following are various utility programs provided under JDK:

  1. Java Development Tools
    • javac
    • java
    • javap
    • jar
    • etc
  2. Source Files
  3. JRE

11. What is JRE?

JRE stands for Java Runtime Environment. It is an implementation of JVM. It contains class libraries, Interpreter, JIT Compiler etc. Only JRE is enough to run the Java program.

12. What is JVM?

JVM stands for Java Virtual Machine. It is a specification provided by SUN Microsystems whose implementation provides an environment to run our Java applications. JVM becomes an instance of JRE at run time.

Sun’s implementations of the Java Virtual Machine (JVM) is itself called as JRE. Sun’s JRE is available as a part of JDK and also as a separate application. Many vendors have implemented JVM. Some of them are SUN JRE, IBM JRE, Oracle JRE etc.