Java Questionar
Java Questionar
Here's a structured **set of 150 Java questions** progressing from **basic to advanced**, covering core concepts,
OOP, collections, multithreading, exceptions, I/O, and more:
---
5. What are data types in Java? List primitive and non-primitive types.
8. What are Java operators? List arithmetic, relational, and logical operators.
10. What are comments in Java? List single-line and multi-line syntax.
---
25. What are loops in Java? List `for`, `while`, and `do-while`.
---
36. What is OOP? List its principles (Abstraction, Encapsulation, Inheritance, Polymorphism).
55. What is the difference between `private`, `protected`, `default`, and `public` access modifiers?
---
---
### **Section 5: Collections Framework (25 Questions)**
---
---
---
---
7. What is autoboxing/unboxing?
---
---
### **3. Exception Handling (15 Questions)**
---
---
---
48. Serialization/deserialization.
---
---
- Array/List sorting/searching.
- Tree/Graph traversals.
Here’s a curated list of **30 real-world Java interview questions** that simulate practical scenarios, testing your ability
to solve everyday problems with code:
---
- Design a cart that calculates discounts (e.g., "Buy 2, Get 1 Free") and taxes.
- *Key Concepts: OOP (classes for `Product`, `Cart`), collections (`HashMap` for items), algorithms.*
- Build a system that triggers alerts when product stock falls below a threshold.
- *Key Concepts: Exception handling, file I/O (log alerts), observer pattern.*
- Simulate validating credit card numbers (Luhn algorithm) and processing payments.
---
4. **ATM Simulation**
5. **Interest Calculator**
- Compute compound interest for savings accounts with varying rates.
6. **Fraud Detection**
---
7. **Post Scheduler**
8. **Trending Hashtags**
9. **Friend Recommendation**
---
---
---
- Adjust temperature based on sensor input (e.g., `if (temp > 30) cool()`).
---
---
---
---
### **Why These Questions?**
**Need solutions or code snippets?** Let me know which problem you’d like to explore! 🚀