🚀 Today I Learned – Java Static in Inheritance & Object Class Today I strengthened my understanding of some important Java concepts: 🔹 Static Variable Inheritance Static variables are inherited, but only one shared copy exists across the entire class hierarchy. 🔹 Static Methods & Method Hiding Static methods are inherited, but they cannot be overridden — they are hidden based on the reference type. 🔹 Execution Order in Inheritance Understanding the flow is important: Static Block → Instance Block → Parent Constructor → Child Constructor 🔹 Object Class as Root Every class in Java automatically inherits from the Object class. 🔹 Default vs Custom toString() By default, toString() returns: ClassName@Hashcode But we can override it to return meaningful and readable output. ✨ Small concepts, but very important for writing clean and predictable Java programs. TAP Academy #Java #OOP #Programming #LearningJourney #ComputerScience #JavaDeveloper #TapAcademy
Java Static Variables & Methods in Inheritance
More Relevant Posts
-
In today's Core Java session, we explored how Java supports compile-time polymorphism by allowing multiple methods with the same name but different parameter lists. What seemed confusing at first became crystal clear through real-time coding and practical implementation under the guidance of Sharath R Sir at TAP Academy What I learned today: What compile-time polymorphism really means Changing number, type & order of parameters * How the compiler decides which method to execute * Writing cleaner, reusable, and structured code Instead of creating multiple method names, overloading helps maintain flexibility while keeping the code clean and readable. Every concept is adding one more strong brick to my Core Java & OOP foundation. #Java #CoreJava #OOP #MethodOverloading #Polymorphism #FullStackDeveloper #LearningJourney #TapAcademy Bibek Singh
To view or add a comment, sign in
-
-
Today I Learned – Object Orientation Rules & Main Method in Java While learning Java, I explored how object relationships work and how a program starts execution. --> HAS-A Relationship Represents composition or aggregation, where one class contains another class object as a member. Example: Car HAS-A Engine --> DOES-A Relationship Represents behavior implementation, where a class performs behavior defined by another type using interfaces or abstract classes. Example: Bird DOES-A Flyable --> Main Method in Java The entry point of a Java application where the Java Virtual Machine starts program execution. Syntax: public static void main(String[] args) Breakdown: • public → Accessible everywhere • static → Can be executed without creating an object • void → Does not return a value • main → Method recognized by JVM to start execution • String[] args → Used to receive command-line arguments #JavaDeveloper #ObjectOrientedProgramming #OOP #JavaLearning #BackendDevelopment #CodingJourney #100DaysOfCode #LearningInPublic #DeveloperCommunity #FutureDeveloper #TechCareer
To view or add a comment, sign in
-
-
💡 Java Strings Decoded: Memory, Mutability & Logic Ever wondered what really happens when we create a String in Java? 🤔 Here’s a quick breakdown of the concept I explored today: 🔹 Strings are immutable – once created, their value cannot be changed. Any modification creates a new object. 🔹 String Constant Pool (SCP) helps optimize memory by storing only one copy of identical string literals. 🔹 Using new String("Java") creates a new object in the heap, even if the same value already exists in the pool. 🔹 == compares memory addresses, while .equals() compares the actual content of strings. Understanding how Java manages strings helps us write more efficient and optimized code. Always learning, always improving 🚀 #TapAcademy #Java #JavaDeveloper #Programming #Coding #LearningInPublic #SoftwareDevelopment #FullStackDeveloper
To view or add a comment, sign in
-
-
When I first started learning Java, garbage collection felt like magic. 1)You create objects. 2)The program get runs. 3)Unused memory gets cleaned up. But Java memory is not just one big box. Here is the simple model: * New objects start in Young Generation * Long-living objects move to Old Generation * Unused objects get removed by the Garbage Collector Example: A temporary list created inside a method usually dies young and gets cleaned quickly. But something like cache data or a session object can survive longer and move to the Old Generation. That matters because: * Young Generation collection is usually fast * Old Generation collection is heavier * Understanding both helps you reason about performance #Java #SpringBoot #BackendDevelopment #SoftwareEngineerr #javadeveloper
To view or add a comment, sign in
-
-
🚀 Java Revision Journey – Day 07 Continuing my Java revision journey, today I focused on the four pillars of Object-Oriented Programming (OOP) in Java. 🔖 Topics Covered 1️⃣ Inheritance Allows one class to acquire the properties and behaviors of another class using the extends keyword. It promotes code reusability and hierarchical relationships between classes. 2️⃣ Encapsulation Wrapping data (variables) and methods into a single unit (class) and restricting direct access using private variables with getters and setters. It ensures data security and controlled access. 3️⃣ Polymorphism Means “many forms”. The same method name can behave differently depending on the situation. Examples: Method Overloading (Compile-time polymorphism) Method Overriding (Runtime polymorphism) 4️⃣ Abstraction Hiding internal implementation details and showing only essential functionality using abstract classes and interfaces. 📌 These four concepts form the foundation of Object-Oriented Programming and scalable Java application design. Every day of revision is strengthening my Java fundamentals step by step. 💻 #Java #OOP #JavaDeveloper #JavaLearning #BackendDevelopment #Programming #JavaRevision #LearningJourney
To view or add a comment, sign in
-
-
Day 29 of Learning Java 🚀 Today I went deeper into understanding how Java actually runs behind the scenes inside the JVM. Some interesting things I discovered today: ⚡ Learned the execution order in Java when a program has static variables → static blocks → instance variables → instance blocks → constructors → methods. ⚡ The JVM usually checks static members first. If there are no static members, execution starts from main() since it is also a static method. ⚡ Understood the use of static variables and how they save memory by storing values in a shared memory area (static segment / class area). ⚡ Learned that objects are also called instances. ⚡ Important concept: Instance variables cannot be accessed directly by static methods Static variables can be accessed by instance methods ⚡ Learned how static blocks can initialize static variables. ⚡ Explored JVM components like Class Loader, Interpreter, and JIT compiler. ⚡ Practiced compiling and running Java programs using Command Prompt (javac and java). ⚡ Also understood that the number of bytecode (.class) files generated depends on how many classes exist in the program. Small steps every day, but building strong Core Java fundamentals. 💻 #Day29 #Java #CoreJava #JVM #Programming #LearningJourney Harshit T
To view or add a comment, sign in
-
-
In today’s Core Java session, we explored how Java supports compile-time polymorphism by allowing multiple methods with the same name but different parameter lists. What seemed confusing at first became crystal clear through real-time coding and practical implementation under the guidance of Sharath R Sir at TAP Academy 💡 What I learned today: ⚙️ What compile-time polymorphism really means 🧩 Changing number, type & order of parameters 📌 How the compiler decides which method to execute 🚀 Writing cleaner, reusable, and structured code Instead of creating multiple method names, overloading helps maintain flexibility while keeping the code clean and readable. Every concept is adding one more strong brick to my Core Java & OOP foundation.🔥 #Java #CoreJava #OOP #MethodOverloading #Polymorphism #FullStackDeveloper #LearningJourney #TapAcademy
To view or add a comment, sign in
-
-
Day 4 of Java Fundamentals 🚀 Today I revised the Inheritance in Java. Inheritance allows a class to acquire properties and methods of another class. Benefits: ✔ Code reusability ✔ Reduced duplication ✔ Better code structure Example: Dogs inherit behavior like eat() from Animal. 🔹 Multiple Inheritance in Java Java does not support multiple inheritance using classes to avoid complexity (diamond problem). However, it can be achieved using interfaces. 🔹 What is an Interface? An interface is a blueprint that contains abstract methods. A class can implement multiple interfaces, allowing Java to achieve multiple inheritance in a safe way. Example: A class can implement both Printable and Scannable interfaces. Learning Java fundamentals step by step to strengthen my core concepts 💻 #Java #LearningInPublic #SoftwareDevelopment #JavaDeveloper
To view or add a comment, sign in
-
✨ DAY-39: 🌳 Understanding DRY Principle in Java through Nature While learning Java, I came across the powerful concept of DRY (Don’t Repeat Yourself) — and the best way I visualized it is through a tree. In nature, a tree doesn’t grow multiple trunks for the same purpose. Instead, it has one strong trunk that supports many branches. 💡 Similarly in Java: Avoid writing the same code again and again Create reusable methods or functions Maintain a single source of truth 🌿 Without DRY: Imagine creating multiple trees for every branch → messy, hard to maintain ❌ 🌿 With DRY: One strong tree (method/class) → multiple branches (reuse) ✅ 👨💻 Java Example: Instead of repeating logic: System.out.println("Welcome"); System.out.println("Welcome"); Use DRY: public void printMessage() { System.out.println("Welcome"); } ✨ Call the method whenever needed! 🚀 Key Benefits: ✔ Cleaner code ✔ Easier maintenance ✔ Better readability ✔ Reduced errors 🌱 Write once, reuse everywhere — just like a tree grows efficiently from a single root. #Java #CleanCode #DRYPrinciple #Programming #CodingJourney #SoftwareDevelopment
To view or add a comment, sign in
-
-
Continuing my progress in Java, I’ve recently explored some important object-oriented and structural concepts that deepen my understanding of how real-world applications are designed. Here are the topics I covered: Containment (Has-A relationship) and how objects can be composed within other classes Method Overloading for achieving compile-time polymorphism Static Import to simplify code by directly accessing static members Inheritance for creating hierarchical relationships and promoting code reusability Packages for organizing classes and maintaining scalable project structure These concepts helped me better understand how to design modular, reusable, and maintainable Java applications. Step by step, moving closer to mastering core Java and applying these concepts in real-world scenarios. #Java #OOP #Programming #LearningJourney #SoftwareDevelopment #CDAC
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