Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
9 views

Core_Java_Interview_Questions

Core_Java_Interview_Questions

Uploaded by

Mr Jerry03
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Core_Java_Interview_Questions

Core_Java_Interview_Questions

Uploaded by

Mr Jerry03
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Core Java Interview Questions

### Basic Java Concepts

1. What are the key features of Java?

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

3. Why is Java platform-independent?

4. Explain the concept of the Java Virtual Machine (JVM).

5. What is the significance of the main() method in Java?

6. What are Java?s access modifiers? Explain their scope.

### OOP Concepts

1. Explain the four principles of Object-Oriented Programming (OOP).

2. What is the difference between class and object?

3. What is inheritance? Explain its types in Java.

4. How is method overloading different from method overriding?

5. What is polymorphism? Provide examples.

6. Explain encapsulation and its advantages.

7. What is abstraction, and how is it implemented in Java?

8. What is the difference between an abstract class and an interface?

9. Why does Java not support multiple inheritance?

### Data Types and Variables

1. What are the different data types in Java?

2. What is the difference between primitive and non-primitive data types?

3. Explain the concept of typecasting in Java. What are widening and narrowing conversions?

4. What is a static variable and when do we use it?

5. What are the differences between final, finally, and finalize()?

### Control Statements


1. What are Java?s decision-making statements? Explain with examples.

2. What is the difference between while and do-while loops?

3. What is the purpose of the break and continue statements?

4. How does the switch statement work in Java? Explain its limitations.

### Strings

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

2. How are strings immutable in Java?

3. How does the String.intern() method work?

4. How can you reverse a string in Java?

5. What are common methods of the String class?

### Exception Handling

1. What is an exception in Java? How is it different from an error?

2. What are the types of exceptions in Java?

3. Explain the use of try, catch, finally, throw, and throws.

4. What is the difference between checked and unchecked exceptions?

5. How do you create a custom exception in Java?

### Collections Framework

1. What is the Java Collections Framework?

2. What is the difference between ArrayList and LinkedList?

3. What is the difference between a HashMap and a HashSet?

4. Explain the difference between List, Set, and Map.

5. What is the difference between Iterator and ListIterator?

6. What are generics in Java? Why are they used?

### Multithreading

1. What is the difference between process and thread?

2. What are the ways to create a thread in Java?


3. What is the difference between Runnable and Thread?

4. Explain thread lifecycle in Java.

5. How does synchronization work in Java? Why is it necessary?

6. What is a deadlock in multithreading? How can it be avoided?

### File I/O and Serialization

1. What are the different ways to read and write files in Java?

2. What is the difference between FileReader and BufferedReader?

3. What is serialization in Java? How is it implemented?

4. What is the role of the transient keyword during serialization?

5. What are the differences between byte streams and character streams?

### Java Keywords

1. What is the this keyword? When is it used?

2. What is the purpose of the super keyword?

3. What is the difference between static and final keywords?

4. Explain the use of the volatile keyword in Java.

5. What is the difference between == and equals() in Java?

### Memory Management

1. How does garbage collection work in Java?

2. What is the purpose of the System.gc() method?

3. What are strong, weak, soft, and phantom references in Java?

4. What is a memory leak in Java? How can it be prevented?

5. Explain the concept of Stack and Heap memory in Java.

### Java 8 Features

1. What are functional interfaces in Java 8?

2. Explain the concept of lambda expressions with examples.

3. What is the purpose of the Stream API in Java 8?


4. What is the difference between forEach and a traditional for loop?

5. What are default and static methods in interfaces?

### Miscellaneous

1. What are marker interfaces in Java? Give examples.

2. Explain the difference between Comparable and Comparator.

3. What is the difference between synchronized block and method?

4. What is the difference between == and instanceof in Java?

5. Explain the concept of class loaders in Java.

6. What are the uses of finalize() method in Java?

You might also like