Java Fundamentals: Classes, Objects & Coding Conventions

🚀 Day 17 – Core Java | Classes, Objects & Coding Conventions Today’s session was about strengthening the foundation of Object-Oriented Programming before moving to arrays. We didn’t jump to a new topic. We reinforced what truly matters. 🔑 What We Covered ✔ Classes & Objects – Practical Implementation We created a Car class with: Instance Variables → name, cost, mileage Methods → start(), accelerate(), stop() Then we created multiple objects and traced how memory behaves. 🧠 Memory Understanding (Very Important) When object is created: Stack → Holds reference variables Heap → Stores actual object Each object has separate memory Two objects of same class: Have same blueprint But different memory locations No shared data unless explicitly referenced This clarity prevents confusion between: Object creation Reference variables Pass by value Pass by reference ✔ Method Execution Flow When calling: c.start(); Stack frame of main exists New stack frame of start() is pushed Executes Pops after completion Understanding stack frames = Understanding Java execution. ✔ Static vs Non-Static Clarification We saw why: main() is static Non-static methods cannot be directly accessed inside static context Object creation is required This confusion is common in interviews. Now it’s clear. ✔ Coding Conventions (Professional Practice) We learned industry-level naming standards: 🔹 Class Name → PascalCase Example: CarDetails 🔹 Method & Variable Name → camelCase Example: calculateTotal() These conventions don’t affect compilation — But they define professionalism. ✔ Built-in vs User-Defined User-defined: Your own classes Your own methods Built-in: Scanner String Exception Thread StringBuilder (and thousands more) We also learned: Ctrl + Shift + O → Auto import in Eclipse 💡 Biggest Takeaway 70% of Java foundation is already built: Data types Variables Methods Classes Objects Execution flow Everything upcoming (Arrays, Strings, OOP concepts, Advanced Java) depends on this base. If stack & heap are clear → Java becomes easy. If not → Every future topic feels difficult. Strong foundation today = Strong developer tomorrow. #Day17 #CoreJava #ObjectOrientedProgramming #JavaExecution #StackAndHeap #CodingStandards #JavaDeveloper #LearningJourney

To view or add a comment, sign in

Explore content categories