0% found this document useful (0 votes)
2 views1 page

Java Interview Questions With Answers

The document provides a list of common Java technical interview questions and their answers, covering key concepts such as features of Java, differences between JDK, JRE, and JVM, method overloading vs overriding, inheritance, and more. It also explains important topics like polymorphism, encapsulation, abstraction, and differences between data structures like HashMap and Hashtable. Additionally, it introduces Lambda expressions in Java 8 as a feature for functional programming.

Uploaded by

bhavanasai2031
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Java Interview Questions With Answers

The document provides a list of common Java technical interview questions and their answers, covering key concepts such as features of Java, differences between JDK, JRE, and JVM, method overloading vs overriding, inheritance, and more. It also explains important topics like polymorphism, encapsulation, abstraction, and differences between data structures like HashMap and Hashtable. Additionally, it introduces Lambda expressions in Java 8 as a feature for functional programming.

Uploaded by

bhavanasai2031
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Java Technical Interview Questions with Answers

1. What are the main features of Java?


Answer: Java is platform-independent, object-oriented, secure, robust, portable, and
supports multithreading.

2. What is the difference between JDK, JRE, and JVM?


Answer: JDK (Java Development Kit) provides tools to develop Java programs, JRE
(Java Runtime Environment) is required to run them, and JVM (Java Virtual Machine)
executes the bytecode.

3. What is the difference between method overloading and overriding?


Answer: Overloading happens within the same class with different parameter lists.
Overriding occurs in subclass with the same method signature as the superclass.

4. What is inheritance in Java?


Answer: Inheritance allows one class to inherit properties and behavior from another
class using the 'extends' keyword.

5. What is the difference between String, StringBuilder, and StringBuffer?


Answer: String is immutable, while StringBuilder and StringBuffer are mutable.
StringBuffer is synchronized, but StringBuilder is not.

6. What is polymorphism?
Answer: Polymorphism allows one interface to be used for different data types. It can
be achieved via method overloading and overriding.

7. What is encapsulation?
Answer: Encapsulation is the process of wrapping data (variables) and methods into
a single unit (class) and restricting access using access modifiers.

8. What is abstraction?
Answer: Abstraction hides implementation details and only shows essential features.
It can be achieved using abstract classes and interfaces.

9. What is the difference between HashMap and Hashtable?


Answer: HashMap is non-synchronized and allows one null key, while Hashtable is
synchronized and doesn’t allow null keys or values.

10. What are Lambda Expressions in Java 8?


Answer: Lambda expressions enable functional programming by allowing you to write
anonymous methods using the syntax `(parameters) -> expression`.

You might also like