Top 150+ Java Interview Questions and Answers

    58 Votes


10. What is Just in Time Compiler ?

Just in time Compiler (JIT) compiles JAVA byte code to native machine code and execute it directly on the underlying hardware. Just-In time compilation provides application execution speeds near to C or C++ application.
11. What is Java Development Kit (JDK) ?

Java Development Kit (JDK) is a superset of the JRE, which contains Java Run-time Environment (JRE) , Compilers and debuggers required to develop applets and applications.

12. What is Garbage Collector ?
For executing programs, application allocate memory at runtime. After execution of programs, unused memory needs to be deallocated. Allocation and deallocation of memory is done by programmers developing application using C,/C++ programming language. Java internally uses a garbage collector to deallocate unused memory which makee the life of programmer easier.
13. What is class loader ?

Class loader is used to load all the classes required to execute the application into the Java Virtual Machine (JVM). Once the classes are loaded, the memory required for the application is determined.

14. What is byte code verifier ?

Byte code verifier checks for illegal code like forged pointers, violated access rights on objects etc. in complied byte code.

15. What are the java verifications done by byte code verifier ?

1. Check whether classes follow JVM specification for classes
2. Check for stack overflows
3. Check for access restriction violations
4. Illegal data conversions

16. What is Java API?

An application programming interface (API) is a library of functions that Java provides for programmers, for common tasks like file transfer, networking, and data structures.

17. Give Some examples of Java API.

  • Java.applet - Applet class
  • Java.awt - Windows, buttons, mouse, etc.
  • Java.awt.image - image processing
  • Java.awt.peer - GUI toolkit
  • Java.io - System.out.print
  • Java.lang - length method for arrays; exceptions
  • Java.net - sockets
  • Java.util - System.getProperty

18. What is an applet?

An applet is a small Java program that runs within a web page on your browser. Unlike a traditional desktop application, an applet is severely limited as to what it can perform on your desktop.

  • Applet read and write files.
  • Applet integrates with desktop services (e.g., e-mail).
  • It is connected to other servers.
  • It is also built with security in mind.
  • If the user allows, an applet can be given more authority.

Java OOPS Interview Questions and Answers

19. What is a class?

Classes are used to define objects of a certain type. For example - Car, Person etc. To define the characteristics of a class, variables and the methods are used.

20. What is an object?

An object is an instance of a classes, which has it's own private collection of properties (i.e. data) and methods (i.e. operations).

21. What an object contains?

An object has - State and Behavior

22. What is object oriented program?

An Object-Oriented Program consists of a group of cooperating objects, exchanging messages, in-order to  achieve a common objective.

23. What are the benefit's of OOPS?

  • Real-world programming
  • Reusability of code
  • Modularity of code 
  • Resilience to change
  • Information hiding

24. What are the features of OOPS?

  • Encapsulation 
  • Abstraction 
  • Inheritance 
  • Polymorphism
Page 2 of 14

Related Articles

Java OOPS Interview Questions and Answers
Top Advanced Java Interview Questions and Answers
Java Collections Interview Questions and Answers
Java Thread Interview Questions and Answers

Popular Videos

How to speak to people

How to speak so that people want to listen.

Got a tip or Question?
Let us know