Day 11 — #100DaysOfJava ☕ No new topic today. Only revision — and honestly, it felt more valuable than learning something new. Java Basics ---------------------- ->JVM runs your code. JDK is the full toolkit to write and run Java. JRE is just for running. ->Variables store data — int, double, String, boolean. ->Scanner reads user input from keyboard. I went back through Day 1–9 and here’s my journey in short: • Basics: JVM, JDK, JRE, variables, Scanner • Strings & Arrays: Immutable strings, StringBuilder, fixed-size arrays • OOP: Overloading, overriding, this, super, constructors • Advanced OOP: Abstract classes, inner/anonymous classes, boxing • Interfaces & Lambda: Functional interfaces, lambda, enum • Exceptions & Threads: try-catch, throw/throws, start vs run • Collections: List, Set, Map, Iterator basics • Modern Java: Optional, record, var, sealed classes • Tools: Maven (pom.xml), AWS EC2 basics Big realization: Concepts that confused me earlier now make sense — revision is powerful. Most people rush ahead. Slowing down helped me more. What’s your revision strategy? -What is your revision strategy? -Drop it in the comments . would love to learn from you! Day 1 ....................... 10 ✅ #100DaysOfJava #Java #JavaDeveloper #LearningInPublic #100DaysOfCode #BackendDevelopment #Revision #CodeEveryDay #JavaBeginners #LearnJava
Java Basics and Revision Strategy
More Relevant Posts
-
🌊 Java Streams changed how I write code forever. Here's what 9 years taught me. When Java 8 landed, Streams felt like magic. After years of using them in production, here's the real truth: What Streams do BRILLIANTLY: ✅ Filter → map → collect pipelines = clean, readable, expressive ✅ Method references make code self-documenting ✅ Parallel streams can speed up CPU-bound tasks (with caveats) ✅ flatMap is one of the most powerful tools in functional Java What Streams do POORLY: ❌ Checked exceptions inside lambdas = ugly workarounds ❌ Parallel streams on small datasets = overhead, not gains ❌ Complex stateful operations get messy fast ❌ Stack traces become unreadable — debugging is harder My 9-year rule of thumb: Use streams when the INTENT is clear. Fall back to loops when the LOGIC is complex. Streams are about readability. Never sacrifice clarity for cleverness. Favorite advanced trick: Collectors.groupingBy() for powerful data transformations in one line. What's your favorite Java Stream operation? 👇 #Java #Java8 #Streams #FunctionalProgramming #JavaDeveloper
To view or add a comment, sign in
-
Day 8 — #100DaysOfCode —Java is getting more interesting every day. ☕ Today I stepped into modern Java features and honestly, some of these changed how I think about writing clean code. Here is what I explored: Optional class — before this, I used to worry about NullPointerException everywhere. Optional gives you a clean way to handle "value might not exist" without crashing your program. Simple but powerful. Record class — I used to write a full class just to store data. Constructor, getters, equals, toString — all manually. A record does all of that in ONE line. Java is becoming really elegant. LVTI (var keyword) — instead of writing the full type every time, you just write var and Java figures it out. Less typing, same result. Clean and readable. Sealed classes — you can now control exactly which classes are allowed to extend your class. No unexpected subclasses. More control over your code design. Method references — instead of writing a full lambda, you can just point to an existing method. list.forEach(System.out::println) — short and clean. 8 days in. The concepts are getting deeper but that just means I am moving forward. Day 1 ✅ Day 2 ✅ Day 3 ✅ Day 4 ✅ Day 5 ✅ Day 6 ✅ Day 7 ✅ Day 8 ✅ If you work with modern Java features daily, would love to connect and learn! 🙏 #Java #ModernJava #Records #Optional #LVTI #SealedClasses #100DaysOfCode #JavaDeveloper #LearningInPublic #BackendDevelopment
To view or add a comment, sign in
-
𝟰 𝗟𝗮𝗺𝗯𝗱𝗮 𝗦𝗸𝗶𝗹𝗹𝘀 𝗘𝘃𝗲𝗿𝘆 𝗝𝗮𝘃𝗮 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿 𝗦𝗵𝗼𝘂𝗹𝗱 𝗠𝗮𝘀𝘁𝗲𝗿 (𝗝𝗮𝘃𝗮 𝟮𝟱) Java lambdas are no longer just about method references and simple stream chains. From Java 21 to 25, lambdas became much more expressive, cleaner, and safer. Here are 4 modern lambda skills worth mastering 👇 1. 𝗨𝗻𝗻𝗮𝗺𝗲𝗱 𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲𝘀 _ (𝗝𝗮𝘃𝗮 𝟮𝟮+) When a lambda parameter is not needed, _ makes the intent clear. 𝘨𝘳𝘰𝘶𝘱𝘦𝘥.𝘧𝘰𝘳𝘌𝘢𝘤𝘩((_, 𝘰𝘳𝘥𝘦𝘳𝘴) -> 𝘱𝘳𝘰𝘤𝘦𝘴𝘴(𝘰𝘳𝘥𝘦𝘳𝘴)); No more fake names like ignored or unused. Cleaner intent, better readability. 𝟮. 𝗦𝘁𝗿𝗲𝗮𝗺 𝗚𝗮𝘁𝗵𝗲𝗿𝗲𝗿𝘀 (𝗝𝗮𝘃𝗮 𝟮𝟰+) This is the biggest Stream API upgrade since Java 8. 𝘯𝘶𝘮𝘣𝘦𝘳𝘴.𝘴𝘵𝘳𝘦𝘢𝘮() .𝘨𝘢𝘵𝘩𝘦𝘳(𝘎𝘢𝘵𝘩𝘦𝘳𝘦𝘳𝘴.𝘸𝘪𝘯𝘥𝘰𝘸𝘚𝘭𝘪𝘥𝘪𝘯𝘨(3)) .𝘵𝘰𝘓𝘪𝘴𝘵(); Perfect for: ✔ sliding windows ✔ moving averages ✔ running totals 𝟯. 𝗣𝗮𝘁𝘁𝗲𝗿𝗻 𝗠𝗮𝘁𝗰𝗵𝗶𝗻𝗴 𝗶𝗻 𝘀𝘄𝗶𝘁𝗰𝗵 (𝗝𝗮𝘃𝗮 𝟮𝟭+) Type-safe dispatch inside stream pipelines now feels natural. .𝘮𝘢𝘱(𝘯 -> 𝘴𝘸𝘪𝘵𝘤𝘩 (𝘯) { 𝘤𝘢𝘴𝘦 𝘌𝘮𝘢𝘪𝘭(_, 𝘚𝘵𝘳𝘪𝘯𝘨 𝘴𝘶𝘣𝘫𝘦𝘤𝘵, _) -> 𝘴𝘶𝘣𝘫𝘦𝘤𝘵; 𝘤𝘢𝘴𝘦 𝘚𝘮𝘴(𝘚𝘵𝘳𝘪𝘯𝘨 𝘱𝘩𝘰𝘯𝘦, _) -> 𝘱𝘩𝘰𝘯𝘦; }) No instanceof chains, fewer casts, safer refactoring. 𝟰. 𝗥𝗲𝗰𝗼𝗿𝗱 𝗣𝗮𝘁𝘁𝗲𝗿𝗻𝘀 𝗶𝗻 𝗦𝘁𝗿𝗲𝗮𝗺𝘀 (𝗝𝗮𝘃𝗮 𝟮𝟭+) Destructure records directly inside filters and stream logic. .𝘧𝘪𝘭𝘵𝘦𝘳(𝘰 -> 𝘰 𝘪𝘯𝘴𝘵𝘢𝘯𝘤𝘦𝘰𝘧 𝘖𝘳𝘥𝘦𝘳(_, _, 𝘥𝘰𝘶𝘣𝘭𝘦 𝘢𝘮𝘰𝘶𝘯𝘵, 𝘚𝘵𝘳𝘪𝘯𝘨 𝘴𝘵𝘢𝘵𝘶𝘴) && "𝘗𝘈𝘐𝘋".𝘦𝘲𝘶𝘢𝘭𝘴(𝘴𝘵𝘢𝘵𝘶𝘴)) This removes getter noise and makes intent much clearer. Modern Java changed what good lambda code looks like. The primitives are the same: Function, Predicate, Stream But what you can now express inside them is far more powerful. 🚀 If you still write lambdas like Java 8, Java 25 gives you a much better way. Which Java 25 lambda feature are you most excited to try? #Java #Java25 #ModernJava #Lambdas #BackendDevelopment #SoftwareEngineering #JavaDeveloper
To view or add a comment, sign in
-
While working on backend systems, I revisited some features from Java 17… and honestly, they make code much cleaner. One feature I find really useful is Records. 👉 Earlier: We used to write a lot of boilerplate just to create a simple data class. Getters Constructors toString(), equals(), hashCode() ✅ With Java 17 — Records: You can define a data class in one line: public record User(String name, int age) {} That’s it. Java automatically provides: ✔️ Constructor ✔️ Getters ✔️ equals() & hashCode() ✔️ toString() 💡 Practical usage: User user = new User("Dipesh", 25); System.out.println(user.name()); // Dipesh System.out.println(user.age()); // 25 🧠 Where this helps: DTOs in APIs Response objects Immutable data models What I like most is how it reduces boilerplate and keeps the code focused. Would love to know — are you using records in your projects? #Java #Java17 #Backend #SoftwareEngineering #Programming #Microservices #LearningInPublic
To view or add a comment, sign in
-
Your code might be correct… but is it safe when 100 threads run it at the same time?⚠️ While revisiting Java Core alongside Spring Boot, I realized something important i.e. single-threaded thinking doesn’t scale in real-world systems. So I dived into Multithreading & Concurrency, and here’s what clicked 👇 🔷 Process vs Thread A process is an independent program, while threads are lightweight units within it. Threads share memory → powerful but also risky if not handled properly. 🔷 Thread Creation & Lifecycle Understanding states like NEW → RUNNABLE(RUNNING) → BLOCKED / WAITING / TIMED_WAITING → TERMINATED gave clarity on how threads actually behave under the hood. 🔷 Inter-Thread Communication Concepts like wait(), notify(), notifyAll() showed how threads coordinate instead of conflicting. 🔷 Thread Joining, Daemon Threads & Priority join() ensures execution order Daemon threads run in background Priorities hint scheduling (but not guaranteed) 🔷 Locks & Synchronization 🔐 synchronized blocks/methods Advanced locks like ReentrantLock, ReadWriteLock, StampedLock, Semaphore These ensure controlled access to shared resources. 🔷 Lock-Free Concurrency Using Atomic variables & CAS (Compare-And-Swap) for better performance without heavy locking. 🔷 Thread Pools (Game Changer) Instead of creating threads manually: ThreadPoolExecutor manages threads efficiently Avoids overhead and improves scalability 🔷 Future, Callable & CompletableFuture Handling async tasks in a cleaner way: Future → get result later Callable → returns value CompletableFuture → chain async operations (very powerful in backend systems) 🔷 Executor Types FixedThreadPool CachedThreadPool SingleThreadExecutor ForkJoinPool (Work Stealing) 🔷 Scheduled Tasks Using ScheduledThreadPoolExecutor to run tasks after delay or periodically. 🔷 Modern Java – Virtual Threads Lightweight threads that can handle massive concurrency with minimal resources, huge shift in how backend systems can scale. 🔷 ThreadLocal Maintains thread-specific data: useful in request-based applications like Spring Boot. And now it’s easier to see how Spring Boot internally applies these concepts to handle multiple requests efficiently. #Java #Multithreading #Concurrency #SpringBoot #BackendDevelopment #SoftwareEngineering #LearningJourney #Running #Thread #Process #Locks
To view or add a comment, sign in
-
-
Most Java devs know Collections exist. Few know which one to actually pick. 🧵 After years of backend work, I still see the same mistakes in code reviews: LinkedList used where ArrayList is 3x faster HashMap in multi-threaded code with no sync Custom objects in HashSet without equals() + hashCode() So I built this visual cheat sheet. 9 slides. Every collection. Real trade-offs. Here's what's inside 👇 📌 Full hierarchy from Iterable down to every implementation 📌 ArrayList vs LinkedList =>when each actually wins 📌 HashSet / LinkedHashSet / TreeSet => ordering guarantees explained 📌 HashMap vs TreeMap vs LinkedHashMap =>feature table 📌 Queue & Deque => why ArrayDeque beats Stack and LinkedList 📌 Big-O cheat sheet => all 10 collections in one table 📌 Top 5 interview questions => with answers that impress 🚀 My Daily Java Collections Decision Rule Confused which collection to use? This quick guide helps me every day 👇 👉 Need fast random access? → ArrayList ⚡ 👉 Need unique elements + fast lookup? → HashSet 🔍 👉 Need key-value pairs (default choice)? → HashMap 🗂️ 👉 Need sorted data? → TreeMap / TreeSet 🌳 👉 Need Stack / Queue operations? → ArrayDeque 🔄 👉 Need priority-based processing? → PriorityQueue 🏆 ♻️ Repost if this helps a Java dev on your feed. #Java #JavaDeveloper #Collections #DataStructures #Backend #BackToBasics #SpringBoot #CodingInterview #SoftwareEngineering #Programming
To view or add a comment, sign in
-
🚀 Day 11: Scope & Memory – Mastering Variable Types in Java 🧠📍 Today’s focus was on understanding where data lives in a program—a crucial step toward writing efficient and predictable code. In Java, the way a variable is declared directly impacts its scope, lifetime, and memory allocation. Here’s how I broke it down: 🔹 1. Local Variables – Temporary Workers ⏱️ • Declared inside methods • Accessible only within that method • Created when the method starts, destroyed when it ends • ⚠️ Must be initialized before use (no default values) 🔹 2. Instance Variables – Object Properties 🏠 • Declared inside a class, outside methods • Require an object to access • Each object gets its own copy • Changes in one object do NOT affect another 🔹 3. Static Variables – Shared Data 🌐 • Declared with the static keyword • Belong to the class, not objects • Accessed using the class name (no object needed) • Only one copy exists, shared across all instances 💡 Key Takeaway: Variable scope is more than just visibility—it’s about memory management and data control. Knowing where and how variables exist helps in building optimized and scalable applications. Step by step, I’m strengthening my foundation in Java and moving closer to writing production-level code. 💻 #JavaFullStack #CoreJava #CodingJourney #VariableScope #MemoryManagement #Day11 #LearningInPublic
To view or add a comment, sign in
-
Is your Java knowledge still stuck in 2014? ☕ Java has evolved massively from version 8 to 21. If you aren't using these modern features, you’re likely writing more boilerplate code than you need to. I’ve been diving into the "Modern Java" era, and here is a quick roadmap of the game-changers: 🔹 Java 8 (The Foundation) 1. Lambda Expressions 2. Stream API 3. Optional 🔹 Java 11 (The Cleanup) 1.New String Methods – isBlank() and repeat() are life-savers. 2.HTTP Client – Finally, a modern, native way to handle REST calls. 3.Var in Lambdas – Cleaner syntax for your functional code 🔹 Java 17 (The Architect's Favorite) 1.Records – One-line immutable data classes. No more boilerplate! 2.Sealed Classes – Take back control of your inheritance hierarchy. 3.Text Blocks – Writing SQL or JSON in Java is no longer a nightmare. 🔹 Java 21 (The Performance King) 1.Virtual Threads – High-scale concurrency with zero overhead. 2.Pattern Matching – Use switch like a pro with type-based logic. 3.Sequenced Collections – Finally, a standard way to get first() and last(). Java isn't "old"—it's faster, more concise, and more powerful than ever. If you're still on 8 or 11, it’s time to explore what 17 and 21 have to offer. #Java #SoftwareEngineering #Backend #Coding #ProgrammingTips #Java21
To view or add a comment, sign in
-
🧠 JVM — The Brain of Java Everyone says “Java is platform independent”… But the real magic? It’s the JVM silently doing all the heavy lifting. Think of the JVM like the brain of your Java program — constantly thinking, optimizing, managing, and protecting. Here’s what’s happening behind the scenes: Class Loader Before anything runs, the JVM loads your .class files into memory. It’s like the brain gathering information before making decisions. Runtime Data Areas The JVM organizes memory like a well-structured mind: • Heap → where objects live • Stack → method calls & execution flow • Method Area → class-level data Everything has its place. No chaos. Just structure. Execution Engine This is where the real action happens. Bytecode is converted into machine code using an interpreter or optimized using JIT (Just-In-Time compiler). Translation: Your code gets faster the more it runs. Garbage Collector One of the smartest parts of the JVM. It automatically removes unused objects from memory. No manual cleanup. No memory leaks (mostly). Security & Isolation The JVM runs your code in a sandbox. That’s why Java is trusted for large-scale systems. Why this matters? When you understand the JVM, you stop just “writing code”… You start writing efficient, optimized systems. Because at the end of the day — Java doesn’t just run. The JVM thinks. #Java #JVM #BackendDevelopment #Programming #SoftwareEngineering #Tech
To view or add a comment, sign in
-
-
🚀 Spring Core Concepts Simplified: Dependency Injection & Bean Loading While diving deeper into Spring Framework, I explored two important concepts that every Java developer should clearly understand 👇 🔹 Dependency Injection (DI) Spring provides multiple ways to inject dependencies into objects: ✅ Setter Injection Uses setter methods Flexible and optional dependencies Easier readability ✅ Constructor Injection Uses constructors Ensures mandatory dependencies Promotes immutability & better design 💡 Key Difference: Constructor Injection is preferred when dependencies are required, while Setter Injection is useful for optional ones. 🔹 Bean Loading in Spring Spring manages object creation using two strategies: 🗨️ Eager Initialization (Default) Beans are created at container startup Faster access later May increase startup time 🗨️ Lazy Initialization Beans are created only when needed Saves memory & startup time Slight delay on first use 🔍 When to Use What? ✔ Use Constructor Injection → when dependency is mandatory ✔ Use Setter Injection → when dependency is optional ✔ Use Eager Loading → for frequently used beans ✔ Use Lazy Loading → for rarely used beans 📌 Understanding these concepts helps in writing cleaner, maintainable, and scalable Spring applications. #SpringFramework #Java #BackendDevelopment #DependencyInjection #CodingJourney #TechLearning
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development