0% found this document useful (0 votes)
10 views2 pages

Java Interview Cheat Sheet

This Java Interview Cheat Sheet covers essential topics including OOP principles, important Java concepts, collections, exception handling, multithreading, Java 8 features, Spring Boot essentials, Hibernate basics, and important coding patterns. Key distinctions such as abstract classes vs interfaces and the use of collections like List, Set, and Map are highlighted. It emphasizes clear explanations and confidence in responses over complex solutions.

Uploaded by

gihasin490
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)
10 views2 pages

Java Interview Cheat Sheet

This Java Interview Cheat Sheet covers essential topics including OOP principles, important Java concepts, collections, exception handling, multithreading, Java 8 features, Spring Boot essentials, Hibernate basics, and important coding patterns. Key distinctions such as abstract classes vs interfaces and the use of collections like List, Set, and Map are highlighted. It emphasizes clear explanations and confidence in responses over complex solutions.

Uploaded by

gihasin490
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
You are on page 1/ 2

Java Interview Cheat Sheet

JAVA INTERVIEW CHEAT SHEET

1. OOP Principles: Inheritance, Encapsulation, Polymorphism, Abstraction.

2. Important Java Concepts:

- Abstract Class vs Interface: Interface = 100% abstraction; Abstract class = Partial abstraction.

- '==' checks reference; '.equals()' checks content.

- final keyword: prevents change (variable), inheritance (class), overriding (method).

3. Collections Summary:

- List (ArrayList, LinkedList): Ordered, duplicates allowed.

- Set (HashSet, LinkedHashSet, TreeSet): Unordered (except Linked), no duplicates.

- Map (HashMap, TreeMap): Key-value pairs, unique keys.

- HashMap: Not synchronized. Hashtable: Synchronized.

4. Exception Handling:

- Checked: Must handle (e.g., IOException).

- Unchecked: Runtime errors (e.g., NullPointerException).

- finally always executes.

5. Multithreading:

- Thread vs Runnable: Runnable preferred.

- synchronized keyword for thread-safety.

- volatile keyword: Prevents caching issues.

- wait(), notify(), notifyAll() for thread communication.

6. Java 8 Features:

- Lambda: (args) -> {body}

- Functional Interface: Interface with only one abstract method (@FunctionalInterface).

- Stream API: For processing collections.


- Optional: Avoid NullPointerException.

7. Spring Boot Essentials:

- @Component, @Service, @Repository: Specialization of @Component.

- Dependency Injection: Injecting dependencies via constructor, setter, or field.

- REST APIs: CRUD operations with @RestController.

8. Hibernate Basics:

- ORM tool for Java.

- Session.beginTransaction(), session.save(), session.commit().

9. Important Coding Patterns:

- Reverse a string using StringBuilder or loop.

- Find missing number: Sum formula or XOR method.

- Use HashSet to detect duplicates.

REMEMBER: Clear explanation + Confidence > Fancy solutions.

You might also like