We are so back 😁 Day 12 of #100DaysOfCode Two weeks of exams slowed me down but today I finally got to do what I have been itching to do the whole time. We are picking up exactly where I left off. Today was a big one, a lot of revision was needed. After my revision, I had to go deeper into these topics: 1. ArrayList, I like to think of these as arrays that we can add or shrink as we add or remove items. Also the wrapper classes, they contain are full objects which allows us to do so much cool stuff like the "add" method which is similar to "append" in python and many others. 2. Generics, when we use generics we are kind off telling the ArrayList to only store a certain type of object. 3. Exceptions, this explains how java handles errors and my role as a developer in that process. I also love how Chris (BroCode) teaches this topic in particular. He continually emphasizes on the importance of letting users understand what exactly went wrong when a program crashes. Now File handling, writing files: ✅ FileWriter, this is perfect for writing small text files. ✅ BufferedWriter, this is much faster and perfect for larger sized text files. ✅ PrintWriter, I learnt this is best for structured data. ✅ FileOutputStream, this is also good for binary files. Reading files was a bit different as I had to combine BufferedReader and FilerReader. The more code I wrote, the more exceptions popped up, and the more knowledge I have gained. Today felt amazing. This is exactly where I want to be. Day 12 done. I will upload the pictures soon. Still studying! #100DaysOfCode #Java
Day 12 of 100 Days of Java Coding
More Relevant Posts
-
🚀 Day 52 of My DSA Journey Today, I solved Reverse Words in a String (LeetCode 151) 💻 This problem tested my understanding of string manipulation, trimming, and efficient traversal. 🔹 Problem Statement: Given a string s, reverse the order of words while removing extra spaces. 🔹 Key Learnings: ✅ Handling leading, trailing, and multiple spaces ✅ Using split() with regex (\\s+) ✅ Efficient use of StringBuilder for better performance ✅ Traversing array in reverse order 🔹 Approach: Trim the string to remove extra spaces Split words using regex Traverse from end to start Append words with single space 🔹 Example: Input: " hello world " Output: "world hello" Another Example: Input: "the sky is blue" Output: "blue is sky the" 🔹 Code Insight (Java): Used StringBuilder to efficiently build the reversed string without extra space issues. Consistency is the key 🔑 — showing up every day and improving step by step. #Day52 #DSA #Java #LeetCode #CodingJourney #100DaysOfCode #Programming #PlacementPreparation 🚀 If you want, I can also create a more viral version (with hooks + storytelling) to get more reach 🔥Here’s a clean and engaging LinkedIn post for your Day 52 of DSA Journey with an example: 🚀 Day 52 of My DSA Journey Today, I solved Reverse Words in a String (LeetCode 151) 💻 This problem tested my understanding of string manipulation, trimming, and efficient traversal. 🔹 Problem Statement: Given a string s, reverse the order of words while removing extra spaces. 🔹 Key Learnings: ✅ Handling leading, trailing, and multiple spaces ✅ Using split() with regex (\\s+) ✅ Efficient use of StringBuilder for better performance ✅ Traversing array in reverse order 🔹 Approach: Trim the string to remove extra spaces Split words using regex Traverse from end to start Append words with single space 🔹 Example: Input: " hello world " Output: "world hello" Another Example: Input: "the sky is blue" Output: "blue is sky the" 🔹 Code Insight (Java): Used StringBuilder to efficiently build the reversed string without extra space issues. Consistency is the key 🔑 — showing up every day and improving step by step. #Day52 #DSA #Java #LeetCode #CodingJourney #100DaysOfCode #Programming #PlacementPreparation 🚀
To view or add a comment, sign in
-
-
Day 52 of Sharing What I’ve Learned 🚀 LinkedList in Java — Advantages & Disadvantages After exploring how LinkedList powers structures like Queue, I took a step back to understand something important — 👉 When should we actually use LinkedList, and when should we avoid it? 🔹 Advantages of LinkedList ✔ Dynamic Size No need to define size in advance — it grows and shrinks as needed. ✔ Efficient Insertions & Deletions Adding/removing elements is fast, especially at the beginning or middle. (No shifting like arrays!) ✔ Memory Utilization (Flexible Allocation) Memory is allocated as needed, not wasted upfront. ✔ Implements Multiple Structures Can be used as: ✔ List ✔ Queue ✔ Deque 🔹 Disadvantages of LinkedList ❌ More Memory Usage Each node stores extra references (pointers), increasing memory overhead. ❌ Slow Access (No Indexing) Unlike ArrayList, you can’t directly access elements — traversal is required. ❌ Poor Cache Performance Elements are not stored contiguously → slower compared to arrays. ❌ Not Ideal for Searching Searching is O(n), making it inefficient for large datasets. 🔹 LinkedList vs ArrayList (Quick Insight) 👉 Use LinkedList when: ✔ Frequent insertions/deletions ✔ Working with Queue/Deque 👉 Use ArrayList when: ✔ Fast access is needed ✔ More read operations than write 🔹 Key Insight 💡 Every data structure has trade-offs — 👉 The real skill is knowing when to use which one. 🔹 Day 52 Realization 🎯 Understanding limitations is just as important as learning features — That’s what makes you a better problem solver. #Java #LinkedList #DataStructures #CollectionsFramework #Programming #DeveloperJourney #100DaysOfCode #Day52 Grateful for guidance from, Sharath R TAP Academy
To view or add a comment, sign in
-
-
Day 3 of Java with DSA Journey 🚀 📌 Topic: Guess Number Higher or Lower (LeetCode 374) 💬 Quote: "Efficiency is not about doing more; it's about eliminating what doesn't matter." ✨ What I Learned: 🔹 Binary Search Beyond Arrays: Binary Search isn’t limited to arrays — it works perfectly on a number range like [1...n]. 🔹 Working with APIs: Learned how to adapt logic based on API responses: -1 → Guess is too high 1 → Guess is too low 0 → Correct answer 🔹 Power of Efficiency: Even for a huge range (up to 2³¹ - 1), Binary Search finds the answer in ~31 steps 🤯 Compared to Linear Search → practically impossible! 🔹 Complexity: ⏱ Time: O(log n) 📦 Space: O(1) 🧠 Problem Solved: ✔️ Guess Number Higher or Lower 💡 Key Insight: This problem highlights the “Narrowing the Search Space” concept. Each step eliminates half the possibilities — that’s the magic of logarithmic algorithms ⚡ ⚡ Interview Insight (3-Way Decision Logic): Unlike boundary problems, here we deal with three outcomes: 1️⃣ 0 → Found the number (return immediately) 2️⃣ -1 → Move right = mid - 1 3️⃣ 1 → Move left = mid + 1 👉 Use while (left <= right) since the target is guaranteed to exist. 🔑 Takeaway: Consistency beats intensity. Showing up daily is what builds mastery. #DSA #LeetCode #Java #CodingJourney #BinarySearch #ProblemSolving #100DaysOfCode #JavaDeveloper #Algorithms
To view or add a comment, sign in
-
-
☕ Learn Java with Me — Day 7 7 days ago, we were just thinking about starting. Overthinking. Waiting for the “right time”. Today? We showed up for 7 days straight. No big results. No perfect code. But we learned: → Variables & Data Types → Operators → If-Else → Loops → Methods And today, we tried something practical: 👉 Taking user input in Java Example: import java.util.Scanner; Scanner sc = new Scanner(System.in); System.out.println("Enter your name:"); String name = sc.nextLine(); System.out.println("Hello " + name); This made things feel real. Now it’s not just logic — we can interact with users too. More importantly: → We stopped waiting → We started doing → We stayed consistent From confused → a little more confident. Still beginners. But not at Day 1 anymore. And that matters. Week 2 starts tomorrow 🚀 Comment “STARTED” if you’re learning with me 👇 #java #coding #learning #consistency #ITstudent #showup
To view or add a comment, sign in
-
-
Day 62 of Sharing What I’ve Learned🚀 Iterator in Java — Safe and Efficient Traversal After understanding how collections store and organize data, I revisited an important concept — how to safely traverse them using Iterator. 👉 Accessing data is easy… but doing it correctly and safely matters more. 🔹 What is an Iterator? Iterator is an interface in Java used to traverse elements of a collection one by one. 👉 It provides a standard way to loop through: ArrayList HashSet LinkedList And more… 🔹 Why not just use a for loop? Using a normal loop works… but it has limitations: ❌ Not safe when modifying collection ❌ Can lead to ConcurrentModificationException ❌ Not universal for all collection types 👉 That’s where Iterator comes in ✔ 🔹 Key Methods of Iterator hasNext() → checks if next element exists next() → returns the next element remove() → removes the current element safely 🔹 Example import java.util.*; public class Main { public static void main(String[] args) { ArrayList<String> list = new ArrayList<>(); list.add("Java"); list.add("Python"); list.add("C++"); Iterator<String> it = list.iterator(); while(it.hasNext()) { String lang = it.next(); System.out.println(lang); } } } 🔹 Real Advantage 💡 👉 Removing elements while iterating: Iterator<String> it = list.iterator(); while(it.hasNext()) { if(it.next().equals("Python")) { it.remove(); // Safe removal } } ✔ No errors ✔ Clean logic ✔ Interview-friendly concept 🔹 Day 62 Realization Traversing data is not just about loops — it’s about doing it safely and efficiently. 👉 Iterator provides better control and prevents runtime issues 👉 Essential when working with dynamic collections #Java #Collections #DataStructures #CollectionsFramework #Iterator #Programming #DeveloperJourney #100DaysOfCode #Day61 Grateful for guidance from, TAP Academy Sharath R kshitij kenganavar
To view or add a comment, sign in
-
-
🚀 𝐍𝐞𝐰 𝐕𝐢𝐝𝐞𝐨 𝐎𝐮𝐭 — 𝐖𝐡𝐲 𝐀𝐫𝐫𝐚𝐲 𝐈𝐧𝐝𝐞𝐱 𝐒𝐭𝐚𝐫𝐭𝐬 𝐟𝐫𝐨𝐦 𝟎? (Beginner Friendly) Ever wondered why arrays in Java start from 0 instead of 1? 🤔 This is one of the most common questions beginners have — and understanding this will level up your programming fundamentals. In this video, I’ve explained the concept in a simple and practical way — not just theory, but the real reason behind it. 🎬 𝐓𝐨𝐩𝐢𝐜: Why Index Starts at 0 in Arrays 💡 𝐈𝐧 𝐭𝐡𝐢𝐬 𝐯𝐢𝐝𝐞𝐨 𝐲𝐨𝐮’𝐥𝐥 𝐥𝐞𝐚𝐫𝐧: ✅ What is an Array & what is Index ✅ Why indexing starts from 0 (core concept) ✅ Memory concept behind arrays (important 🔥) ✅ How JVM calculates element position ✅ Formula: base_address + (index * size) ✅ Why starting from 0 makes access faster 💡 I’ve explained this using a simple memory visualization: • First element → base address (index 0) • Next elements → calculated using offset • No extra calculation needed → more efficient ⚡ This helps you understand how things work internally, not just remember syntax. 📺 Watch Video 👇 https://lnkd.in/ga3iaUNN 💬 Did you know this before, or did you think arrays should start from 1? 🔁 Share this with someone learning Java — this concept clears a lot of confusion 🚀 #Java #JavaCourse #LearnJava #Programming #SoftwareEngineering #Developers #Coding #Arrays #DataStructures #CodingJourney #NVerse
To view or add a comment, sign in
-
-
Coding agents are innovating fast, but they're also getting bloated. To actually understand what they’re doing, you have to go back to the basics. A good way to learn is to get into it. Adding LSP support to the 260 line nanocode agent in #Java https://lnkd.in/ec5j8QpJ
To view or add a comment, sign in
-
🚀 Day 11 of Java with DSA Journey — This one blew my mind 🤯 📌 Problem: Power of Three (LeetCode 326) Yesterday, I used bit manipulation for Power of Two. Today? 👉 That approach completely fails. So I had to think differently… 💡 Breakthrough Idea Instead of loops or recursion… I used math + number theory to solve it in O(1) time. 👉 1162261467 % n == 0 Yes, one line. 🧠 Key Learnings 🔹 Bitwise isn’t universal Works great for base-2, but not for base-3 🔹 Prime Numbers Matter Since 3 is prime, its powers divide each other perfectly 🔹 Max Value Trick Largest power of 3 in 32-bit int = 3^19 = 1162261467 ⚡ Complexity ⏱ Time: O(1) 📦 Space: O(1) 🔥 Pro Tips (Interview Level) 💡 Tip 1: Know Your Data Type Limits Many O(1) tricks depend on constraints like 32-bit integer limits 💡 Tip 2: Prime Numbers Unlock Shortcuts If a number is prime, its powers have clean divisibility properties 💡 Tip 3: Always Question the Default Approach Most people write: while (n % 3 == 0) n /= 3; 💡 Tip 4: This is a Pattern Power of 2 → bitwise Power of 3 → math Power of 4 → hybrid 💡 Tip 5: Edge Cases First Always check n <= 0 🔥 Real Insight This problem forced me to shift my thinking: ❌ Rely on one technique ✅ Adapt based on the problem Consistency compounds 📈 #DSA #LeetCode #Java #CodingJourney #ProblemSolving #NumberTheory #InterviewPrep #Day11 #BitManipulation #CleanCode #Array #Optimization #MCA #lnct #100DaysOfCode #SoftwareEngineering #Algorithms #InPlaceAlgorithms #TechLearning #JavaDeveloper
To view or add a comment, sign in
-
-
🚀 Starting My Java Journey I’ve recently started learning Java and diving into Data Structures & Algorithms. So far, I’ve learned: • Basics of Java (variables, loops, conditions) • Arrays and how to work with them • Solving beginner problems on LeetCode I’m really enjoying the process of solving problems and improving my thinking skills. Looking forward to building projects and sharing my progress here! If you have any tips or resources, feel free to share 💻 #Java #DSA #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
🚀 Mastering Time & Space Complexity in Java DSA When I started learning Data Structures & Algorithms in Java, the biggest mindset shift wasn’t coding… it was thinking in complexity. 📌 Time Complexity (⏱️) It tells how fast your code runs as input grows. O(1) → Constant (Best 👍) O(log n) → Logarithmic O(n) → Linear O(n log n) → Efficient sorting O(n²) → Slow (avoid when possible ⚠️) 📌 Space Complexity (💾) It tells how much memory your code uses. Efficient programs don’t just run fast — they also use less memory. 💡 Key Learnings: ✔️ Always analyze before optimizing ✔️ Nested loops ≠ always bad, but be careful ✔️ Trade-offs exist between time & space ✔️ Practice problems to build intuition 🔥 Current Focus: Improving problem-solving by writing optimized Java solutions and analyzing their complexity. Consistency > Motivation 💯 #Java #DSA #CodingJourney #TimeComplexity #SpaceComplexity #Programming #SoftwareEngineering
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