Day 3 of Java From Code to Memory 🧠💻 Today things got REAL. No more JVM theory. No more architecture talk. Today I learned how Java actually stores data inside memory. 👉 Variables. Sounds simple… but it’s powerful. When we write: int age = 21; Java doesn’t just “remember” 21. It: • Reserves space in memory • Decides how many bits to allocate • Stores the value in binary (0s & 1s) • Links it with the name age That moment when you realize… Programming = Managing Memory 🔥 Also understood: Java is statically typed. You must declare the data type first. No mixing random data. Strict but safe. Explored the 8 primitive data types: byte, short, int, long float, double char boolean And yes double wins over float for precision 👀 Biggest takeaway? Behind every simple line of code… there’s memory allocation, bits, and logic working silently. Day 3 and the foundation is getting stronger. We’re not just writing code anymore we’re understanding how machines think. Consistency > Motivation 🚀🔥 Special thanks to Aditya Tandon Sir & Rohit Negi Sir 🙌 #Java #CoreJava #LearningInPublic #Programming #Developers #BuildInPublic
Java Memory Management: Variables & Data Types
More Relevant Posts
-
I just completed an intensive session focused on the core of Java's efficiency: Immutable Strings and Memory Management. While we often use strings daily, understanding what happens under the hood is what separates a coder from a developer. Key Takeaways from the session: The Power of Command Line Arguments: We explored how the String[] args in the main method actually functions, learning how to pass dynamic data into applications via the CLI—a crucial skill for building professional-grade tools . Strings as Objects: In Java, strings aren't just data; they are objects . I learned the three distinct ways to initialize them: using the new keyword, using string literals, and converting character arrays . Memory Architecture (SCP vs. Heap): This was a game-changer. I now understand that Java optimizes memory by using the String Constant Pool (SCP) for literals to prevent duplicates, while the Heap Area allows for duplicate objects when the new keyword is used . The Comparison Trap: I finally mastered the difference between reference comparison and value comparison. Using == compares the memory address (reference), while the .equals() method compares the actual content . Immutability: We began exploring why certain data, like birthdays or names, are best handled as immutable strings—meaning they cannot be changed once created in memory . I'm looking forward to the next phase of this journey: Object-Oriented Programming (OOP)! . #Java #SoftwareDevelopment #Programming #MemoryManagement #TechLearning #JavaDeveloper #CodingJourney #Tapacadmey
To view or add a comment, sign in
-
-
🚀 Day 12 – Understanding Arrays & Implementing Searching Techniques in Java Today’s focus was on mastering Arrays and implementing searching problems using methods in Core Java.this session helped me understand how data is stored, accessed, and processed efficiently using array structures — one of the most fundamental concepts in programming. Instead of writing everything inside main(), I practiced solving problems using properly defined methods to keep the logic clean and reusable. 🧩 What I Worked On: • Creating and initializing arrays • Taking array input from users • Traversing arrays using loops 🛠 Concepts Applied: ✔ Arrays (Declaration, Initialization, Traversal) ✔ Method Creation & Reusability ✔ Parameter Passing (Array as Argument) ✔ Return Statements ✔ Looping Constructs Key Learning Outcomes: • Understood how arrays manage multiple data values efficiently • Learned how to pass arrays to methods • Strengthened searching logic using structured programming • Improved code readability with modular design • Practiced writing clean, maintainable programs Arrays are a foundational step toward mastering Data Structures and Algorithms, and today strengthened that base significantly. Step by step building strong Core Java fundamentals before moving into advanced data structures and backend development #100DaysOfCode #Java #CoreJava #Arrays #DataStructures #ProblemSolving #JavaDeveloper #BackendDevelopment #CodingJourney
To view or add a comment, sign in
-
-
Deep Dive into Java Fundamentals: Collections & Wrapper Classes ☕️ Today was all about strengthening the bedrock of my Java knowledge. I spent the day exploring the theoretical foundations of the Collection Interface, the Collections Utility Class, and Wrapper Classes. Understanding the "why" behind these concepts is just as important as the "how." Here’s a quick breakdown of my key takeaways: Collection vs. Collections: Clarified the distinction between the root interface for data structures and the utility class used for polymorphic algorithms (sorting, searching, etc.). Wrapper Classes: Diving into how Java wraps primitive data types into objects, enabling them to be used within the Collections Framework through Autoboxing and Unboxing. Data Structure Architecture: Looking at how different implementations (List, Set, Queue) handle data differently under the hood. Building a solid theoretical base is essential for writing efficient, scalable code. Back to the IDE to put these theories into practice! #Java #SoftwareDevelopment #JavaFullStack #CodingJourney #BackendDevelopment #ContinuousLearning
To view or add a comment, sign in
-
-
🚀 Day 8 — Restarting My Java Journey with Consistency Today’s topic looked familiar: 🔹 while loop 🔹 do-while loop 🔹 for loop 🔹 break & continue Most of this was already known to me. But revision with depth always reveals something new. 🔁 Loops — More Than Just Repetition We often write: for(int i = 0; i < n; i++) { // code } But today I revisited some important insights: ✔ All three parts in a for loop are optional ✔ Multiple variables can be initialized using comma separation ✔ Conditional statements rely completely on logical operators ✔ do-while is very useful in menu-driven programs (runs at least once) 🤯 Interesting Question Why don’t we usually use short instead of int in loops? Because in Java, due to type promotion, short gets promoted to int during arithmetic operations. So practically, using short in loops doesn’t provide any benefit. That’s not syntax knowledge. That’s understanding how Java works internally. 🆕 The New Concept I Learned — Labels in Java This was something I had never used before. outer: for(int i = 1; i <= 10; i++) { inner: for(int j = 1; j <= i; j++) { break outer; // breaks the outer loop directly } } 🔹 Labels allow us to control outer loops from inside inner loops 🔹 Useful in nested loop scenarios 🔹 Makes flow control very powerful (if used wisely) Learning daily with Coder Army and Aditya Tandon Bhaiya and Rohit Negi Bhaiya #Day8 #Java #Consistency #BackendDevelopment #LearningJourney #SoftwareEngineering #CoderArmy
To view or add a comment, sign in
-
-
📝Day-5 Today, I strengthened my basics by learning about Data Types in Java. 🔹 Data types define what kind of value a variable can store. 🔹 Java has two main categories: 🟢 Primitive Data Types byte | short | int | long | float | double | char | boolean ✔ Store actual values ✔ Fixed memory size ✔ Faster execution 🔵 Non-Primitive Data Types String | Arrays | Classes | Interfaces ✔ Store reference (address) ✔ Can use methods ✔ No fixed size Understanding data types is the foundation of writing efficient and optimized programs. Strong basics lead to strong logic 💡 Every small concept I learn is helping me grow step by step in my Java Full Stack journey. #Java #JavaProgramming #ProgrammingBasics #FullStackDeveloper #CodingJourney #LearningJava #TechJourney #TapAcademy
To view or add a comment, sign in
-
-
Day 3 of Learning Java ☕ Today I focused on strengthening my basics: 📌 Variables – Containers used to store data in memory. 📌 Identifiers – Naming rules in Java (must start with letter, $, or _, cannot use keywords). 📌 Data Types – Understanding different types of data Java can handle. Here are the ranges of primitive data types I learned: byte → 1 byte → -128 to 127 short → 2 bytes → -32,768 to 32,767 int → 4 bytes → -2³¹ to 2³¹-1 long → 8 bytes → -2⁶³ to 2⁶³-1 float → 4 bytes → ~6-7 decimal digits precision double → 8 bytes → ~15 decimal digits precision char → 2 bytes → 0 to 65,535 (Unicode values) boolean → true / false Understanding the size and range of each data type helps in writing optimized and efficient programs. Thank you Rohit bhaiya for this amazing series 🙏 🚀 #Java #LearningJourney #Programming #BeginnerDeveloper #Consistency CoderArmy
To view or add a comment, sign in
-
-
A variable is a container used to store data that can change during the execution of a program. In Java, every variable must have a data type, which defines what kind of data it can store (like int, double, String, etc.). 🔸 Types of Variables in Java 1️⃣ Local Variable A local variable is declared inside a method, constructor, or block. ✔️ Scope: Accessible only within that method/block ✔️ Lifetime: Exists only while the method is executing ✔️ Must be initialized before use 2️⃣ Instance Variable An instance variable is declared inside a class but outside any method. ✔️ Scope: Accessible throughout the class ✔️ Lifetime: Exists as long as the object exists ✔️ Each object has its own copy 🔎 Quick Difference 🔹 Local Variable → Belongs to a method 🔹 Instance Variable → Belongs to an object #Java #Programming #SoftwareDevelopment #Coding #LearningJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Understanding Arrays in Java – Strengths & Drawbacks 📍Arrays are one of the most fundamental data structures in Java. They allow us to store multiple values under a single variable name, making code cleaner and more efficient. But like every tool, arrays come with limitations that every developer should know. 🔑 Key Points: 📌Homogeneous Data Only: Arrays can store only one type of data (e.g., all integers, all strings). 📌Fixed Size: Once declared, the size of an array cannot be changed. Adding or removing elements dynamically isn’t possible. 📌Contiguous Memory Requirement: Arrays need continuous memory blocks. If RAM cannot allocate enough contiguous space, array creation may fail. 📌 Real-Time Example: Imagine you’re building an online shopping cart system. If you use an array to store items, you must decide the cart size in advance (say 10 items). What if a customer wants to add the 11th item? ❌ The array won’t allow it. Also, you can’t mix data types (e.g., product name + price + quantity) in a single array. 👉 That’s why developers often prefer ArrayLists or Collections in Java, which overcome these limitations by allowing dynamic resizing and heterogeneous data storage. 💡 Takeaway: Arrays are great for fixed-size, homogeneous data storage, but for real-world applications where flexibility is key, Collections are the way forward. TAP Academy #Java #CoreJava #ProgrammingBasics #JavaDeveloper #LearningJourney #SoftwareDevelopment #Coding
To view or add a comment, sign in
-
Hitting important stuff on Day 3 – Arrays & Basic Problem Solving in Java✅ 90 Days of Getting Better at Java : Today I focused on Arrays, one of the most used data structures in Java and a foundation for: - Handling collections of data - Backend request processing - Real-world business logic What I covered today: - Declaring & initializing arrays - Iterating using loops - Finding sum, max, and average - Writing clean, readable logic Here’s a simple program I practiced 👇 Java public class ArrayBasics { public static void main(String[] args) { int[] numbers = {10, 20, 30, 40, 50}; int sum = 0; int max = numbers[0]; for (int i = 0; i < numbers.length; i++) { sum += numbers[i]; if (numbers[i] > max) { max = numbers[i]; } } double average = (double) sum / numbers.length; System.out.println("Sum = " + sum); System.out.println("Max = " + max); System.out.println("Average = " + average); } } 💡 Key takeaway: Simple data structures + clean logic = strong backend foundations. If you’re also revisiting Java fundamentals or preparing for backend roles, let’s grow together 🚀 #Java #DSA #BackendDevelopment #SpringBoot #100DaysOfCode #LearningInPublic
To view or add a comment, sign in
-
✨DAY-22: 🚀 Learning Lambda Expressions in Java – Made Simple! Sometimes the best way to understand complex concepts is through real-world examples. In this image, sorting tools in a garage perfectly represents how Lambda Expressions in Java work. Instead of manually checking every tool, we use a clean and powerful lambda expression to filter only what we need — just like keeping only the wrenches from a mixed toolbox. List<Tool> sortedTools = tools.stream() .filter(t -> t.isWrench()) .collect(Collectors.toList()); 🔎 What’s happening here? 👉 stream() – Process the collection 👉 filter() – Apply a condition using a lambda expression 👉 collect() – Gather the filtered results Just like telling someone: “Only keep the wrenches!” That instruction is your lambda expression — short, clear, and powerful. 💡 Why Lambda Expressions? ✔ Cleaner code ✔ Less boilerplate ✔ Better readability ✔ Functional programming support in Java Java 8 introduced lambdas, and they completely changed how we write collection-processing logic. Sometimes coding isn’t about complexity — it’s about expressing logic in the simplest way possible. #Java #JavaProgramming #LambdaExpressions #Java8 #Coding #Developers #ProgrammingHumor
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
LESSGO