🚀 Day 9 of My 90 Days Java Full Stack Challenge Today, I focused on strengthening my understanding of String manipulation, Stack implementation, and Exception Handling in Java. 🧩 Problems Practiced ✔ String Compression Input: "aaabbc" Output: "a3b2c1" Learned how to implement run-length encoding logic using StringBuilder efficiently in O(n) time. ✔ Valid Parentheses Input: "({[]})" Used Stack (including manual stack implementation) to validate proper nesting of brackets. Improved understanding of LIFO and stack-based problem solving. ⚙ Java Concept Practiced ✔ Exception Handling try–catch blocks finally block usage Checked vs Unchecked exceptions Why exceptions shouldn’t be used for normal control flow 🧠 Key Takeaways Importance of handling edge cases Writing optimized code instead of brute force Understanding internal working of Stack Writing cleaner and more structured Java logic Consistency matters more than intensity 💪 #90DaysJavaFullStack #Java #StringManipulation #Stack #ExceptionHandling #LearningInPublic #DeveloperJourney
Niraj Kumar’s Post
More Relevant Posts
-
A simple doubt triggered today’s deep dive. I was revisiting Java’s “Write Once, Run Anywhere” concept when a question hit me: If I can copy C/C++ source code to another OS and run it after compiling, then how is Java different? Why is Java called platform independent? That confusion forced me to experiment instead of just accepting definitions. I: – Compiled individual .java files manually – Observed when .class files were actually created – Deleted them and tested execution behavior – Compared it mentally with how C/C++ produce OS-specific binaries The breakthrough: Java’s portability isn’t at the source level — it’s at the bytecode level. C/C++ require recompilation per platform because they produce machine-specific binaries. Java separates compilation (javac) and execution (JVM), and that architectural split is what enables true portability. The real lesson wasn’t about Java. It was about pushing a doubt until the mental model becomes clear. Sometimes one persistent “why?” is all it takes to understand a system deeply. #LearningInPublic #Java #SystemsThinking #CSJourney
To view or add a comment, sign in
-
🚀 Ever wondered how backend systems handle thousands of requests at the same time? The answer is **Multithreading**. Multithreading allows a program to execute multiple tasks concurrently using multiple threads, improving performance and responsiveness — especially in backend applications. To make this concept easier to understand, I created a **visual guide on Java Multithreading**. 📌 Topics covered in this PDF: • What is Multithreading • Thread Lifecycle in Java • Runnable Interface • Thread Synchronization • Thread Communication (wait, notify, notifyAll) • Daemon Thread • ExecutorService • Thread Pool & Fixed Thread Pool • Single Thread Executor • Future & Callable • Real World Backend Use Cases I tried to explain these concepts with **simple visuals and examples** so beginners can understand multithreading easily. 📄 Feel free to go through the slides. 💬 **Question:** Which multithreading concept do you find most confusing? #Java #Multithreading #JavaDeveloper #BackendDevelopment #Concurrency #SpringBoot #SoftwareEngineering #LearningInPublic
To view or add a comment, sign in
-
Mastery of Java Exception Handling 🛠️ I’m excited to share that I’ve just wrapped up a deep dive into Java Exception Handling! Moving beyond basic logic to building resilient, "crash-proof" applications has been a game-changer. Here’s a snapshot of what I covered today: The Hierarchy: Understanding the nuances between Checked vs. Unchecked exceptions. Granular Control: Differentiating between Fully Checked and Partially Checked exceptions. The Toolkit: Mastering try-catch-finally blocks for robust error recovery. Delegation: Using throws to propagate exceptions up the stack. Customization: Creating tailored Exception objects using throw to handle specific business logic errors. Building software is about more than just the "happy path"—it's about how gracefully you handle the unexpected. Onward to the next challenge! 🚀 #Java #BackendDevelopment #SoftwareEngineering #LearningJourney #JavaProgramming
To view or add a comment, sign in
-
-
🚀 Java 8 New Features – A Game Changer Swipe through to explore the innovations that made Java 8 one of the most transformative releases in the language’s history. 📌 Slide 1: Lambda Expressions Concise, functional-style code that reduces boilerplate and improves readability. 📌 Slide 2: Stream API Process collections with ease using map, filter, and reduce operations. 📌 Slide 3: Functional Interfaces Interfaces with a single abstract method, enabling lambda expressions. 📌 Slide 4: Default & Static Methods Add new behavior to interfaces without breaking existing implementations. 📌 Slide 5: Date & Time API Immutable, thread-safe, and far more intuitive than java.util.Date. 📌 Slide 6: Optional Class Handle null values gracefully and avoid NullPointerException. 📌 Slide 7: Method References Simplify lambda expressions by directly referencing methods. 💡 Java 8 didn’t just add features—it reshaped how developers think about Java. 💬 Which of these features do you use the most in your projects? #Java, #Java8, #JavaProgramming, #FunctionalProgramming, #SoftwareDevelopment, #LearnToCode, #TechEducation, #CodeNewbie, #BackendDevelopment, #StreamAPI, #LambdaExpressions, #CodingJourney, #TechCommunity
To view or add a comment, sign in
-
-
✨DAY-23: 💡 Understanding Functional Interfaces in Java – Made Simple with Real-Life Examples! Sometimes, the best way to understand Java concepts is to connect them with real-world scenarios. This meme perfectly explains three important functional interfaces in Java: ✅ Predicate – Just like checking an ID to verify if someone is above 21. It takes input and returns true or false. ✅ Consumer – Like receiving and eating a pizza 🍕. It takes input and performs an action, but returns nothing. ✅ Supplier – Like a warehouse worker delivering new supplies. It doesn’t take input, but it supplies data when needed. Functional interfaces are the backbone of Lambda Expressions and the Stream API in Java. When we relate them to daily life, the concepts become much easier to understand and remember. 📌 Java becomes powerful when theory meets real-world thinking! #Java #FunctionalInterfaces #Java8 #LambdaExpressions #Programming #CodingLife
To view or add a comment, sign in
-
-
🚀 Stop Writing Boilerplate: Java Records in 17+ If you are still writing private final fields, constructors, getters, equals(), hashCode(), and toString() for simple data carriers, it's time to switch to Records. Introduced as a standard feature in Java 17, Records provide a compact syntax to model immutable data. Why use them? ✅ Conciseness: 1 line of code replaces 30+ lines of boilerplate. ✅ Immutability by default: Thread-safe and predictable. ✅ Intent: Explicitly declares that a class is a pure data carrier. // The old way (before Java 14/16) public class User { private final String name; private final int age; public User(String name, int age) { this.name = name; this.age = age; } // ... getters, equals, hashCode, toString ... } // The Java 17 way public record User(String name, int age) {} #java #java17 #programming #softwareengineering #backend
To view or add a comment, sign in
-
-
🚀 Java 8 Series – Day 6 𝗦𝘁𝗿𝗲𝗮𝗺 𝗔𝗣𝗜 – 𝗜𝗻𝘁𝗲𝗿mediate vs Terminal Operations Yesterday we introduced Streams. Today let’s understand how Streams actually execute. A Stream pipeline has 3 parts: 𝗦𝗼𝘂𝗿𝗰𝗲 → 𝗜𝗻𝘁𝗲𝗿𝗺𝗲𝗱𝗶𝗮𝘁𝗲 𝗢𝗽𝗲𝗿𝗮𝘁𝗶𝗼𝗻𝘀 → 𝗧𝗲𝗿𝗺𝗶𝗻𝗮𝗹 𝗢𝗽𝗲𝗿𝗮𝘁𝗶𝗼𝗻 But what’s the difference between Intermediate and Terminal? 🔹 𝗜𝗻𝘁𝗲𝗿𝗺𝗲𝗱𝗶𝗮𝘁𝗲 𝗢𝗽𝗲𝗿𝗮𝘁𝗶𝗼𝗻𝘀 👉Return another Stream 👉 Lazy in nature 👉 Do NOT execute immediately 𝗘𝘅𝗮𝗺𝗽𝗹𝗲𝘀: ⭐ filter() ⭐ map() ⭐ sorted() ⭐ distinct() ⭐ limit() ⭐ skip() ⭐ flatMap() 𝗘𝘅𝗮𝗺𝗽𝗹𝗲: names.stream() .filter(name -> name.length() > 3) .map(String::toUpperCase); This will NOT execute yet. Why? Because there is no terminal operation. 🔹 𝗧𝗲𝗿𝗺𝗶𝗻𝗮𝗹 𝗢𝗽𝗲𝗿𝗮𝘁𝗶𝗼𝗻𝘀 👉 Trigger the execution 👉 Produce a final result 👉 Close the stream 𝗘𝘅𝗮𝗺𝗽𝗹𝗲𝘀: ⭐ collect() ⭐ forEach() ⭐ reduce() ⭐ count() ⭐ min() ⭐ max() 𝗘𝘅𝗮𝗺𝗽𝗹𝗲: List result = names.stream() .filter(name -> name.length() > 3) .map(String::toUpperCase) .collect(Collectors.toList()); Now it executes. 🔥 𝗜𝗺𝗽𝗼𝗿𝘁𝗮𝗻𝘁 𝗖𝗼𝗻𝗰𝗲𝗽𝘁: 𝗟𝗮𝘇𝘆 𝗘𝘃𝗮𝗹𝘂𝗮𝘁𝗶𝗼𝗻 Streams execute only when a terminal operation is present. This improves performance because operations are chained and optimized internally. Visual Flow Source → filter → map → sorted → collect Single pass processing. Not multiple loops. Tomorrow: Deep dive into map() vs flatMap() 🔥 (Most confusing interview topic) Follow the series if you're building strong Java fundamentals 🚀 #Java #Java8 #StreamAPI #BackendDeveloper #Coding #InterviewPreparation #SpringBoot
To view or add a comment, sign in
-
🧠 Java Basics: The Building Blocks of Code Whether you're just starting your programming journey or revisiting the fundamentals, understanding Java's core components is essential. Here's a quick breakdown of the pillars that power every Java program: 🔹 Variables Think of variables as labeled containers that store data. Java requires you to declare the type of data each variable holds — making your code predictable and efficient. 🔹 Data Types Java offers both primitive types (like int, float, char, boolean) and non-primitive types (like String, arrays, and classes). Choosing the right type is key to memory management and performance. 🔹 Operators Operators are the tools that let you manipulate data. From arithmetic (+, -, *, /) to relational (==, !=, >, <) and logical (&&, ||, !), they help you build logic into your code. #Java, #JavaProgramming, #ProgrammingBasics, #SoftwareDevelopment, #LearnToCode, #TechEducation, #CodeNewbie, #BackendDevelopment, #ObjectOrientedProgramming, #CodingJourney, #TechCommunity
To view or add a comment, sign in
-
-
🚀 Java Core Interview Series – Part 2 Encapsulation in Java Encapsulation is one of the most important OOP principles in Java. It ensures: ✔ Data Hiding ✔ Controlled Access ✔ Secure Object State ✔ Better Maintainability In real backend development: Entities, DTOs, and Services rely on encapsulation. Spring Boot uses getters/setters for data binding and validation internally. Without encapsulation: account.balance = -500 ❌ (Invalid state possible) With encapsulation: Invalid updates are prevented through business logic ✅ Strong Encapsulation = Secure & Maintainable Backend Code 🔥 I’ve explained the concept with a practical BankAccount example in this post. You can find my Java practice code here: 🔗 https://lnkd.in/gkmM6MRM More core Java concepts coming next 🚀 #Java #Encapsulation #OOPS #BackendDevelopment #CoreJava
To view or add a comment, sign in
-
#50DaysOfStreams – Day 2 & Day 3 Continuing my journey of solving one Java Stream problem daily for 50 days 💪 ✅ Day 2: Find Duplicate Elements in a List 🧩 Problem: Given a list of integers, find all elements that appear more than once. 💡 Solution: List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 2, 3, 6, 7, 3); Set<Integer> duplicates = list.stream() .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())) .entrySet() .stream() .filter(entry -> entry.getValue() > 1) .map(Map.Entry::getKey) .collect(Collectors.toSet()); System.out.println(duplicates); ✅ Day 3: Find the Second Highest Number in a List 🧩 Problem: Given a list of integers, find the second highest number using Streams. 💡 Solution: List<Integer> list = Arrays.asList(10, 5, 20, 8, 25, 15); Optional<Integer> secondHighest = list.stream() .distinct() .sorted(Comparator.reverseOrder()) .skip(1) .findFirst(); secondHighest.ifPresent(System.out::println); Consistency > Motivation 🔥 See you tomorrow with Day 4! #Java #Streams #FunctionalProgramming #CodingChallenge #BackendDevelopment #100DaysOfCode
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