Day 36/100 – Working with ArrayList in Java 📚 Today I practiced using ArrayList in Java, a dynamic array that allows flexible storage and manipulation of data. Unlike normal arrays, ArrayList can grow and shrink dynamically, making it very useful in real-world applications. Key learnings: • Adding elements using add() • Storing multiple values dynamically • Finding size using size() • Easier and more flexible than traditional arrays Understanding collections like ArrayList is important for handling data efficiently in Java. Building strong fundamentals step by step. 🚀 #100DaysOfCode #Java #ArrayList #DataStructures #CodingJourney #LearningInPublic
Java ArrayList Practice and Fundamentals
More Relevant Posts
-
Day 7 of #100DaysOfCode — Java is getting interesting ☕ Today I explored the Java Collections Framework. Before this, I was using arrays for everything. But arrays have one limitation — fixed size. 👉 What if we need to add more data later? That’s where Collections come in. 🔹 Key Learnings: ArrayList grows dynamically — no size worries Easy operations: add(), remove(), get(), size() More flexible than arrays 🔹 Iterator (Game changer) A clean way to loop through collections: hasNext() → checks next element next() → returns next element remove() → safely removes element 🔹 Concept that clicked today: Iterable → Collection → List → ArrayList This small hierarchy made everything much clearer. ⚡ Array vs ArrayList Array → fixed size ArrayList → dynamic size Array → stores primitives ArrayList → stores objects Still exploring: Set, Map, Queue next 🔥 Consistency is the only plan. Showing up every day 💪 If you’re also learning Java or working with Collections — let’s connect 🤝 #Java #Collections #ArrayList #100DaysOfCode #JavaDeveloper #LearningInPublic
To view or add a comment, sign in
-
🚀 Beats 100% of all Java solutions on LeetCode! Just solved LeetCode #290 — Word Pattern in Java with 0ms runtime, outperforming every submission. Here's how I approached it 👇 🧩 Problem: Given a pattern (like "abba") and a string of words, check if the words follow the exact same pattern — a full bijection. e.g. pattern = "abba", s = "dog cat cat dog" → true ✅ 💡 My approach: Used a single HashMap<Character, String> to map each pattern character to its corresponding word. The key insight: also check containsValue() to prevent two different characters from mapping to the same word — ensuring true one-to-one bijection. 📊 Results: Runtime: 0 ms — Beats 100.00% 🌿 Memory: 42.65 MB — Beats 80.14% 🔑 Key takeaway: Always verify bijection in both directions — a one-way map is not enough for pattern matching problems. One extra containsValue() check is all it takes! All 44 test cases passed ✅ — Clean, simple, and blazing fast. #LeetCode #Java #DSA #CodingChallenge #ProblemSolving #100Percent #Programming #SoftwareEngineering #CompetitiveProgramming #HashMap
To view or add a comment, sign in
-
-
#TapAcademy #Java #Fullstackdeveloment #Strings Strings in Java are used to store and handle text data. They are created using double quotes. For example, String text = "Hello, World!". Java offers many useful string methods, such as concat(), substring(), and toUpperCase(). You can compare, join, and format strings with these built-in methods. Strings are commonly used for managing text input, output, and data processing in programs.
To view or add a comment, sign in
-
-
Day 33/100 — Threads & Multithreading ⚡ Java can do multiple things at the same time using threads. Thread lifecycle: NEW → RUNNABLE → RUNNING → WAITING → TERMINATED 2 ways to create threads: // Method 1: extend Thread class MyThread extends Thread { public void run() { println("Running!"); } } new MyThread().start(); // NOT run()! // Method 2: Runnable lambda (preferred!) Thread t = new Thread(() -> println("Lambda thread!")); t.start(); Most important rule: ALWAYS call start() — NOT run()! → run() = normal method call (same thread) → start() = creates new thread and calls run() 3 things to remember: → Prefer Runnable over extending Thread → start() not run() → Multiple threads = race conditions possible! 🎯 Challenge: Create 3 threads that each print their name 5 times. Observe the interleaved output! #Java #Threads #Multithreading #CoreJava #100DaysOfJava #100DaysOfCode
To view or add a comment, sign in
-
-
Day 24 – String Methods in Java Today I explored commonly used String methods in Java, which are essential for handling text data. Things I learned: 🔹 length() – finds string length 🔹 charAt() – accesses characters 🔹 substring() – extracts part of string 🔹 equals() – compares values 🔹 Case conversion methods 💡 Key takeaway: String methods are widely used in real-world applications for processing and manipulating text efficiently. Building stronger fundamentals step by step #Java #Strings #Programming #LearningInPublic #CodingJourney #Day24 #100DaysOfJava
To view or add a comment, sign in
-
-
Day 49-What I Learned In a Day (JAVA) Today, I focused on understanding the execution flow of static elements in Java. 🔹 Learned about: • Static variables and how they are shared across objects • Static methods and how they can be accessed without object creation • Static initializer (single-line) • Static initializer (multi-line) This helped me clearly understand how Java handles memory and execution at the class level before objects are created. Building strong fundamentals step by step! #Java #Programming #LearningJourney #OOP #TechSkills
To view or add a comment, sign in
-
-
🚀 Day 10/30 – Real-World Java Development Today I came across the concept of polymorphism. In simple terms, it means the same thing behaving differently based on the situation. In real-world applications, this happens more often than we notice. The same action can give different results depending on the context. For example, a single operation like “process” can behave differently for different types of data or scenarios. What I found interesting is — this helps in writing flexible code instead of repeating the same logic again and again. Still trying to connect these concepts with real use cases 👍 #30DaysChallenge #Java #OOP #BackendDevelopment #LearningJourney
To view or add a comment, sign in
-
🚀 Arrays in Java (Quick Guide) An Array is one of the most important data structures in Java. It stores multiple values of the same data type in a fixed-size container. ✅ Key Features of Arrays Stores elements in contiguous memory Size is fixed once declared Supports index-based access Faster retrieval using index (O(1)) 📌 Example int[] arr = {10, 20, 30, 40}; System.out.println(arr[0]); // Output: 10 🔥 Advantages ✔ Fast access using index ✔ Easy to iterate ✔ Memory efficient for fixed data ⚠ Limitations ❌ Size cannot grow dynamically ❌ Insertion/deletion in middle is costly (O(n)) 💡 When to Use Arrays? 👉 When the size is known in advance 👉 When you need fast indexing 👉 For performance-critical applications Arrays are the foundation for many advanced structures like ArrayList, Heap, Stack, and more. hashtag #Java #Arrays #DSA #Programming #InterviewPreparation
To view or add a comment, sign in
-
-
🚀 **Day 4/30 – LeetCode Java Challenge** Today’s problem pushed me to think beyond basic comparisons and focus on **pattern-based validation**. Worked on a string problem where the key insight was separating characters based on **even and odd indices**, then comparing frequency distributions instead of direct string matching. 📊 **Result:** ✔️ Accepted (752/752 test cases) ⚡ Runtime: 5 ms (Beats 93.81%) 💾 Memory: Efficient (Beats 86.60%) 💡 **What actually mattered today:** * Brute force thinking won’t scale — pattern recognition does * Breaking a problem into smaller logical groups simplifies everything * Frequency arrays can outperform more complex data structures when used correctly Let’s be real: This wasn’t a hard problem, but the approach matters. If you miss the pattern, you overcomplicate it. If you see it early, the solution becomes clean and efficient. Day 4 done. Still building consistency, still sharpening fundamentals. Archana J E Bavani k Deepika Kannan Divya Suresh Hari priya B Devipriya R Harini B Bhavya B Kezia H Vaishnavi Janaki #LeetCode #Java #DSA #ProblemSolving #Consistency #30DaysOfCode
To view or add a comment, sign in
-
-
Starting a 100-day Java series, and this is day 1 ☕ Today, we are covering Java variables - from syntax to scope to memory, all in one place. Declaration, data types, the 3 types of variables, casting, the final keyword and the mistakes most beginners make without realising. 10 slides covering everything. The last slide has a full cheat sheet worth saving.🔖 For more such tech content, follow @herbrewcode on Instagram too. #Java #Day1 #100DaysOfCode #LearnToCode #CodingJourney #HerBrewCode
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