Are you preparing for Java Interview? If so, you are at the right place. This article provides frequently asked Java Interview Questions and Answers on basic & advanced topics covering all the core Java concepts like JVM, JRE, Operators, OOPs, Exceptions, IO operations, Collections etc. for Freshers and experienced Java developers.
Java is a programming language, application development and deployment environment. The Java programming language is similar to C++ syntax. Java development environment provides tools for Compiling, Interpreting, Packaging the Java code.
High performance: The byte codes can be translated at run time into machine code for the particular CPU on which the application is running which inturn provide high performance.
Applet programming: is one of the important features which has attracted the users of the Internet. Applets are Java programs that are typically loaded from the Internet by a browser.
- Java Run Time Environment
- Java Virtual Machine
- Just in Time Compiler
- Java Tools
- Garbage Collector
|Related Java Interview Questions|
|1. Java Collections Interview Questions|
|2. Java Thread Interview Questions|
|3. Java OOPS Interview Questions|
|4. Advanced Java Interview Questions|
|5. JSP Interview Questions|
|6. Servlet Interview Questions|
Java Basics Interview Questions - JVM, JRE & JDK
A self-contained operating environment that behaves as if it is a separate computer. For example, Java applets run in a Java virtual machine (VM) that has no access to the host operating system.
5. What are the advantages of JVM?
This design has two advantages:
- System Independence: A Java application will run the same in any Java VM, regardless of the hardware and software underlying the system.
- Security: Because the JVM has no contact with the operating system, there is little possibility of a Java program damaging other files or applications.
6. What are classpath variables?
The classpath is an environment variable that tells the JVM where to look for user-defined classes and packages in Java programs. When a Java program is executed, JVM looks for the required classes needed for the program execution in the filesystem specified in the Classpath. Classes are loaded into the JVM, only when a call is made to use the content of the class object(Lazy Loading).
7. Explain the architecture of code execution process inside JRE ?
Java Compilers compile JAVA source code into byte code. Java Virtual Machine(JVM) interpreters Java byte code and send necessary commands to underlying hardware or Just in time compiled to native machine code and execute it directly on the underlying hardware.
Most JVM's use Just in time compilation which provides execution speeds near to C/C++ application. Most widely used JVM is Oracle Corporation's HotSpot, which is written in the C++ programming language.
8. What is Java Run Time Environment ?
Java Virtual Machine (JVM) along with Java Class Libraries which implement the Java application programming interface (API) form the Java Runtime Environment (JRE).
9. What are the steps involved in Java Application Execution ?
- Compiling Java Source Files into *.class file. (Byte Code)
- Loading class file into Java Run Time (JRE) using class loader
- Use Bytecode verifier to check for byte code specification
- Use Just In time Code Generator or Interpreter for byte code execution