Java Developer Interview Questions and Answers

Java Developer Interview Questions and Answers

Java is an object-oriented, cross platform, multi-purpose programming language produced by Sun Microsystems. First released in 1995, it was developed to be a machine independent web technology. It was based on C and C++ syntax to make it easy for programmers from those communities to learn.

JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton. It is a simple programming language.  Writing, compiling and debugging a program is easy in java.  It helps to create modular programs and reusable code.

The original and reference implementation Java compilers, virtual machines, and class libraries were originally released by Sun under proprietary licenses. Sun released the first public implementation as Java 1.0 in 1995. It promised Write Once, Run Anywhere (WORA), providing no-cost run-times on popular platforms. On 13 November, 2006, Sun released much of Java as free and open source software under the terms of the GNU General Public License (GPL). As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java (bytecode compiler), GNU Class path (standard libraries), and IcedTea-Web.

The new version is Java SE 9, released on September 21, 2017, and is one of the two versions currently supported for free by Oracle. The new J2 versions were renamed as Java SE, Java EE, and Java ME respectively.The latest version is Java SE 10 (March 20, 2018)

Introduction to Machine Language:

Machine language, the numeric codes for the operations that a particular computer can execute directly. The codes are strings of 0s and 1s, or binary digits (bits), which are frequently converted both from and to hexadecimal (base 16) for human viewing and modification. Machine language consists of very simple instructions that can be executed directly by the CPU of a computer. Almost all programs, though, are written in high-level programming languages such as Java, Pascal, or C++. A program written in a high-level language cannot be run directly on any computer. First, it has to be translated into machine language. This translation can be done by a program called a compiler. A compiler takes a high-level-language program and translates it into an executable machine-language program. Once the translation is done, the machine-language program can be run any number of times, but of course it can only be run on one type of computer (since each type of computer has its own individual machine language). If the program is to run on another type of computer it has to be re-translated, using a different compiler, into the appropriate machine language.

There is an alternative to compiling a high-level language program. Instead of using a compiler, which translates the program all at once, you can use an interpreter, which translates it instruction-by-instruction, as necessary. An interpreter is a program that acts much like a CPU, with a kind of fetch-and-execute cycle. In order to execute a program, the interpreter runs in a loop in which it repeatedly reads one instruction from the program, decides what is necessary to carry out that instruction, and then performs the appropriate machine-language commands to do.

Java Virtual Machine (JVM):

Java Virtual Machine (JVM) is a specification that provides runtime environment in which java bytecode can be executed. As the name implies, the JVM acts as a “virtual” machine or processor. Java’s platform independence consists mostly of its Java Virtual Machine (JVM) Java was designed to allow application programs to be built that could be run on any platform without having to be rewritten or recompiled by the programmer for each separate platform. A Java virtual machine makes this possible because it is aware of the specific instruction lengths and other particularities of the platform. The JVM performs following operation:

  • Loading code
  • Verifies code
  • Executes code


Bytecode (Intermediate code) is object-oriented programming (OOP) code compiled to run on a virtual machine (VM) instead of a central processing unit (CPU). The VM transforms program code into readable machine language for the CPU because platforms utilize different code interpretation techniques. A VM converts bytecode for platform interoperability, but bytecode is not platform-specific. Bytecode is in a compiled Java programming language format and has the .class extension executed by Java Virtual Machine (JVM)

Java Development Kit (JDK):

JDK (Java SE Development Kit) includes a complete JRE (Java Runtime Environment) plus tools for developing, debugging, and monitoring Java applications. JDK is required to develop and run Java applications and applets.

Java Runtime Environment (JRE):

The Java Runtime Environment (JRE), also known as Java Runtime, is part of the Java

Development Kit (JDK), a set of programming tools for developing Java applications. The Java Runtime Environment provides the minimum requirements for executing a Java application; it consists of the Java Virtual Machine (JVM), core classes, and supporting files.

What is Java?

What are the features of Java?

What are the features of JAVA SE8?

What is difference between JDK vs JRE vs JVM?

What is JIT compiler?

What is JDBC Driver?

What is Constructor in java?

What is the role of JDBC DriverManager class?

What is ClassLoader in Java? And Types of ClassLoader?

What is a servlet in java?

What is the number of bits used to represent ASCII, Unicode, the UTF-16, and the UTF-8 characters?

What is the advantage of using a string literal in Java?

What is a pointer and does Java support pointers?

What is the difference between a class variable and an instance variable in Java?

What is the difference between sleep () and wait () methods in Java?

What is the difference between System.Out, System.Errand

What is the difference between ArrayList and Vector in Java?

What is the difference between throw and throws in Java?

What is the difference between JAR and WAR files?

What is the difference between checked and unchecked exceptions?

Can you explain fail-fast and fail-safe iterators? Give examples?

Can we override private method in Java?

What is the return type of main () method in Java?

How to disable session in JSP?

What is an immutable object? Can you write one?

What is wrapper classes?

Explain dot Operator?

How will you implement multiple inheritance in Java?

What is singleton class and how can we make a class singleton?

What is Type Erasure?

What is Applets?

What is an object's lock in Java and which objects have locks?

What is the difference between abstraction and encapsulation?

What is a Spring?

What is Streams in Java? And what is difference between Byte Streams and Character Streams?

What are some of the important spring annotations?

How to delete a Cookie in a JSP?

What is exception handling?

Why am i getting a NoClassDefFoundError in Java?

What is the difference between web server and app server?

What is difference between ArrayList and LinkedList in Java?

Follow us on Social Media

Related Posts

No Comments

Post a Reply