🚀 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
Java Fundamentals: Classes, Objects & Coding Conventions
More Relevant Posts
-
🚀 Day 17 – Java Full Stack Journey | Classes, Objects & Coding Conventions Today’s session was not just about code. It was about thinking like a real software developer. 🔹 1️⃣ Class & Object – Core Revisited We implemented a real-world example: class Car { String name; float cost; float mileage; public void start() { System.out.println("Car is starting"); } public void accelerate() { System.out.println("Car is accelerating"); } public void stop() { System.out.println("Car is stopping"); } } Then created multiple objects: Car c1 = new Car(); Car c2 = new Car(); 💡 Key Understanding: Each object is stored in Heap Reference variables are stored in Stack Every object has its own independent state Changing c2.name does NOT affect c1.name This strengthened memory visualization: Stack Frame → Heap Object → Method Execution → Garbage Collection 🔹 2️⃣ Static vs Non-Static (Important Clarification) We understood why: Cannot make a static reference to a non-static method Main method is static. Non-static methods require object creation. This confusion is common — clarity here builds strong OOPS foundation. 🔹 3️⃣ Java Naming Conventions (Professional Coding Standards) Today we also learned something very important for interviews & real projects: ✔ Class → PascalCase CarDetails StudentRecord ✔ Methods & Variables → camelCase calculateTotal() studentName printSquare() Clean code is not optional in IT industry — it’s expected. 🔹 4️⃣ User-Defined vs Built-In Classes Examples of built-in classes: Scanner String Exception Thread We even explored the internal implementation of Scanner class inside Eclipse. Java has 5000+ built-in classes — You don’t memorize them. You learn how to use them effectively. 🔹 5️⃣ Bigger Picture – Why All This Matters Today’s reminder: Everything we’ve learned so far: Data Types Variables Methods Objects Memory Flow This is 70% of Java foundation. Advanced Java, Spring, Hibernate, Real Projects — Everything builds on this base. Weak basics = Struggle later Strong basics = Smooth growth 🚀 💡 Realization of the Day: Learning Java is not about finishing syllabus. It’s about: Consistency Practice Writing clean structured code Thinking like a developer Day 17 Complete ✔ #Day17 #Java #CoreJava #OOPS #StackAndHeap #FullStackJourney #LearningInPublic #JavaDeveloper #100DaysOfCode TAP Academy
To view or add a comment, sign in
-
-
🚀 Day 11 – Mastering Methods, Return Statements & Logical Problem Solving in Java Today’s focus was on writing cleaner, reusable, and structured Java code using methods, arguments, and return statements. Instead of solving problems in a single block inside main(), I concentrated on breaking logic into well-defined methods — making the code more modular and closer to real-world application design. 🧩 What I Worked On: Solved multiple logical challenges with different difficulty levels, including: • Multiplication Table Generator • Sum of Odd Numbers from 1 to N • Factorial Calculator using Functions • Sum of Digits of an Integer • Additional number-based logical problems Each solution was implemented using proper method creation and structured flow control. 🛠 Concepts Applied: ✔ Method Creation & Reusability ✔ Return Statements for Result Handling ✔ Parameter Passing (Arguments) ✔ Looping Constructs (for / while) ✔ Conditional Logic (if-else) ✔ Clean Code Organization ✔ Console-Based Program Execution 🔎 Key Learning Outcomes: • Understood how to design reusable methods instead of writing repetitive code • Improved logical thinking by solving multi-step problems • Learned proper separation of concerns inside small applications • Strengthened foundation in function-based programming • Practiced writing readable and maintainable code This day helped me move from just “writing code” to structuring code properly. Building strong Core Java fundamentals step by step before advancing into Collections Framework, Exception Handling, and Backend Development 🚀 #100DaysOfCode #Java #CoreJava #ProblemSolving #JavaDeveloper #SoftwareDevelopment #BackendDevelopment #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 16 – Java Full Stack Journey | Methods (All 4 Types) & Memory Execution Deep Dive Today was about mastering one of the most powerful concepts in Java: 👉 Methods 👉 Parameters vs Arguments 👉 Stack & Heap execution flow Not just writing methods — but understanding how they execute inside memory. 🔹 The 4 Types of Methods in Java 1️⃣ No Input – No Output public void greet() { System.out.println("Hello World"); } 2️⃣ No Input – With Output public int add() { return 50 + 40; } 3️⃣ With Input – No Output public void add(int a, int b) { int c = a + b; System.out.println(c); } 4️⃣ With Input – With Output public int add(int a, int b) { return a + b; } This is the most commonly used type in real-world applications. 🔹 Important Terminologies ✔ Parameters → Variables declared in method signature ✔ Arguments → Values passed during method call Example: add(50, 40); int a, int b → Parameters 50, 40 → Arguments 🔹 What Happens in Memory? When a method is called: 1️⃣ A Stack Frame is created 2️⃣ Local variables are stored inside the stack 3️⃣ Objects are created inside the Heap 4️⃣ After execution → Stack frame is removed 5️⃣ Objects without references → Become Garbage 6️⃣ Garbage Collector cleans them automatically This follows LIFO (Last In, First Out) principle. Understanding this makes debugging and interviews much easier. 🔹 Real Power of Methods Instead of rewriting logic multiple times: printSquare(n); printSquare(n2); printSquare(n3); You write the logic once, reuse it multiple times. ✔ Code Reusability ✔ Clean Structure ✔ Reduced Code Duplication ✔ Better Maintainability 💡 Biggest Learning Today Java is not about memorizing syntax. It’s about: Understanding execution flow Knowing how memory behaves Writing reusable, structured logic These fundamentals build the foundation for: OOPS → Exception Handling → Collections → Multithreading → Real Projects Strong basics = Strong developer. Day 16 Complete ✔ #Day16 #Java #CoreJava #Methods #StackAndHeap #JVM #GarbageCollection #OOPS #FullStackJourney #LearningInPublic TAP Academy
To view or add a comment, sign in
-
-
🏗️Constructors: The Blueprint of Object Creation in Java🏗️ I just wrapped up a focused quiz module on Constructors in Java, scoring 8.5 out of 9! ✅ Constructors are the gateway to object-oriented programming - they define how objects are born, initialized, and prepared for use. This deep dive reinforced that while constructors seem straightforward, mastering their nuances is essential for writing clean, maintainable code. Topics Explored: - Default Constructor - Understanding when the compiler provides one automatically (and when it doesn’t). - No-Argument Constructor - Explicitly defining constructors with no parameters for flexible object creation. - Parameterized Constructors - Injecting initial state directly at object instantiation, ensuring objects are created in a valid state. - "this" Keyword - Disambiguating between instance variables and constructor parameters (e.g., "this.name = name"). - "this()" Constructor Chaining - Calling one constructor from another to avoid code duplication and enforce mandatory initialization rules. The Mistakes made : I scored perfectly on most sections, but the half-point deduction came from one of the "Constructor in Java" questions (scored 0.5/1). These subtle deductions are always the most valuable - they highlight the edge cases and nuances that separate "it compiles" from "it's production-ready." In this case, it was likely a question about constructor inheritance, the rules of constructor chaining, or when the default constructor is *not* automatically provided. Why This Matters: Constructors are more than just syntax - they're your first line of defense for creating valid objects. Understanding them deeply helps you: - Ensure object integrity - Objects are never left in an partially initialized state. - Write DRY code - Reuse initialization logic via `this()` instead of duplicating it. - Avoid subtle bugs - Like accidentally losing the default constructor when adding a parameterized one, which can break framework expectations (e.g., JPA, Spring). If you're also revisiting Java fundamentals, I'd love to hear: What's the most surprising constructor behaviour you've encountered? Or a tricky constructor question that stumped you in an interview? Drop it in the comments! 👇 #Java #Constructors #ObjectOrientedProgramming #CleanCode #SoftwareEngineering #LearningJourney #CoreJava TAP Academy
To view or add a comment, sign in
-
-
💡 3 Java Features That Instantly Made My Code Cleaner While working on my backend projects, I realized that writing code is not just about making it work — it's about making it clean, readable, and maintainable. Here are 3 Java features that helped me improve my code quality: 1️⃣ Optional Helps avoid "NullPointerException" and makes null handling much clearer. 2️⃣ Try-with-resources Automatically closes resources like database connections, files, etc. This reduces boilerplate code and prevents resource leaks. 3️⃣ Stream API Allows operations like filtering, mapping, and collecting data in a much more readable way compared to traditional loops. Example: Instead of writing multiple loops and conditions, streams allow concise and expressive operations on collections. 📌 Key takeaway: Small language features can significantly improve code readability and reduce bugs. What Java feature improved your coding style the most? #Java #BackendDevelopment #CleanCode #Programming #SoftwareDevelopment
To view or add a comment, sign in
-
🚀 Building Your First Java Application: A Beginner’s Milestone in Programming Podcast: https://lnkd.in/g-hkNQQz Starting your journey in programming can feel overwhelming — but building your first Java application is a powerful confidence booster. Java remains one of the most trusted and widely used programming languages in the world. Its platform independence, reliability, and strong ecosystem make it an excellent choice for beginners and professionals alike. Here’s a simple roadmap to getting started: 🔹 Step 1: Install the JDK (Java Development Kit) Download and install the latest JDK (Oracle or OpenJDK). Set your JAVA_HOME variable correctly. Verify installation using: java -version 🔹 Step 2: Set Up an IDE While you can code in Notepad, using an IDE like IntelliJ IDEA, Eclipse, or NetBeans makes development smoother with features like: • Syntax highlighting • Code completion • Built-in debugging tools 🔹 Step 3: Write Your First Program Create a class called HelloWorld and add: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } Compile → Run → See “Hello, World!” in the console. That moment? Pure satisfaction. 🔹 What’s Next? After your first program, explore: • Variables and Data Types • Control Structures • Object-Oriented Programming • Exception Handling 🔹 Common Beginner Mistakes • Missing semicolons • Incorrect braces • NullPointerException • Array index errors Every developer starts somewhere. The key isn’t perfection — it’s consistency. Building your first Java application isn’t just about printing text to the console. It’s about understanding how code transforms into something executable. It’s about learning how systems think. And most importantly — it’s about taking the first step. If you’re just starting with Java, what challenges are you facing right now? Let’s discuss 👇 #Java #Programming #SoftwareDevelopment #CodingJourney #TechCareers #LearnToCode
To view or add a comment, sign in
-
-
Java Full Stack Development – Day 13 | Tap Academy Topic Covered: 🔹 Pass by Value vs Pass by Reference 🔹 Different Types of Methods in Java 🔹 Memory Segments in Java (Stack, Heap, Static) 1️⃣ Pass by Value ✔ In Java, primitive variables are passed by value. ✔ A copy of the variable is sent to the method. ✔ Changes inside the method do not affect the original value. Example: int a = 1000; int b; b = a; System.out.println(a); System.out.println(b); Output 1000 1000 2️⃣ Pass by Reference (Objects) ✔ Object reference is passed to methods. ✔ Changes made to the object affect the original object. Example: Car c1 = new Car(); c1.name = "MARUTHI"; c1.noOfSeats = 5; c1.cost = 8.66f; System.out.println(c1.name); System.out.println(c1.noOfSeats); System.out.println(c1.cost); Output MARUTHI 5 8.66 3️⃣ Different Types of Methods Java methods are classified into 4 types: 1️⃣ No Input – No Output 2️⃣ No Input – Output 3️⃣ Input – No Output 4️⃣ Input – Output These help in structuring programs and improving code reusability. 4️⃣ Memory Segments in Java Java uses different memory areas: Static Segment • Stores static variables. Stack Segment • Stores method calls and local variables. • Each method has its own stack frame. Heap Segment • Stores objects created using new. Example Concept: class Calculator { int a = 50; int b = 40; void add() { int c = a + b; System.out.println(c); } } ✔ Object stored in Heap ✔ Method execution stored in Stack Conclusion Today’s session helped in understanding how Java handles data passing, method types, and memory management, which are fundamental concepts for becoming a strong Java Full Stack Developer. #Java #JavaFullStack #TapAcademy #Programming #JavaDeveloper #CodingJourney #LearnJava #FullStackDeveloper #SoftwareDevelopment #JavaLearning
To view or add a comment, sign in
-
-
Mastering Object Initialization: A Deep Dive into Java Constructors 🏗️☕ When we talk about Object-Oriented Programming, we often focus on the "what" (Classes) and the "how" (Methods). But the "When" is just as important—and that is where Constructors come in. Think of a constructor as the "Building Crew" of your code. It’s the very first block of code that runs to set the foundation for every new object you create. 🧱 🔍 What is a Java Constructor? As shown in the guide, a constructor is a special method used to initialize objects. It has three unique rules: It must have the same name as the class. It has no return type (not even void). It is called automatically the moment you use the new keyword. The Three Musketeers of Initialization: 1️⃣ Default Constructor (The Auto-Builder) 📦 Role: If you don't write a constructor, Java provides one for you. Function: It initializes your fields with default values like 0, false, or null. Analogy: It’s like buying a "standard" house model—it comes with the basic layout already set. 2️⃣ Parameterized Constructor (The Custom Architect) 🛠️ Role: Allows you to pass specific data during object creation. Function: It lets you set unique initial values for different objects. Analogy: This is a custom-built home. You tell the builder exactly what color you want and how many windows to install from day one. 3️⃣ Copy Constructor (The Perfect Clone) 📑 Role: Initializes a new object using the values of an existing object. Function: It creates a distinct, new instance that is a "copy" of another. Analogy: You see a house you love and tell the builder, "Build me exactly what they have!" 💡 Why should you care? Properly using constructors ensures your objects start their "life" in a valid state. It prevents "null pointer" headaches and makes your code more predictable and professional. Which constructor do you find yourself using the most in your daily projects? Let's talk shop in the comments! 👇 #Java #OOP #Coding #SoftwareEngineering #JavaDeveloper #TechTutorial #ProgrammingTips
To view or add a comment, sign in
-
-
🚀 Java Jumpstart: From Installation to “Hello, World!” — A Beginner’s Roadmap Every developer remembers the first time they ran a “Hello, World!” program. It’s a small output on the screen, but a massive milestone in a coding journey. This visual roadmap perfectly breaks down the process of building your first Java application: 🔹 Install the JDK Download the latest Java Development Kit and configure the JAVA_HOME variable correctly. Always verify installation using java -version in your CLI. 🔹 Choose Your IDE Tools like IntelliJ IDEA, Eclipse, or NetBeans simplify development with debugging support, syntax highlighting, and structured project management. 🔹 Create Your First Project Initialize a Java project, create a HelloWorld class, and define the entry point: public static void main(String[] args) 🔹 Compile to Bytecode → Run via JVM Java’s platform independence works because your code compiles into bytecode, which the JVM can execute on any system. This is the foundation of “Write Once, Run Anywhere.” 🔹 Avoid Common Errors • Syntax mistakes • NullPointerException • Array index errors 🔹 Keep Learning Once comfortable, explore: ✔ Variables and Data Types ✔ Control Structures ✔ Object-Oriented Programming ✔ Exception Handling The journey from installation to execution teaches more than syntax — it builds logical thinking and system understanding. If you're starting with Java in 2026, what’s been your biggest challenge so far? #Java #Programming #SoftwareDevelopment #CodingJourney #LearnToCode #TechCareers
To view or add a comment, sign in
-
-
Good Monday! Let’s start the week with a deep analysis by Java luminary Brian Goetz on carrier classes, records and the future of the language as is being developed in Project Amber. Sorry about the format, it is very clumsy, maybe a copy-paste on your favorite text editor will help. https://lnkd.in/eh3BQAYy #Java #DataOrientedProgramming #Java26AndBeyond #ProjectAmber
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