🚀 Day 14 of Java Learning 📌 Today’s Topic: Instance Block vs Static Block vs Constructor 💡 Here’s what I learned: ✔️ Static Block → Executes only once (at class loading time) ✔️ Instance Block → Runs every time an object is created ✔️ Constructor → Initializes the object after instance block ✔️ Execution Order → Static → Main → Instance → Constructor → Method 🧠 Key Takeaways: 🔹 Static blocks are useful for one-time setup 🔹 Instance blocks run before constructors 🔹 Constructors help in object initialization 🔹 Understanding execution flow is super important for interviews 💻 Practiced with code examples to understand real execution flow 🔥 📈 Consistency is the key — one step closer to mastering Java! #Java #Programming #Coding #Developers #OOP #100DaysOfCode
Java Instance Block vs Static Block vs Constructor
More Relevant Posts
-
#Day_13 of My Java Learning Journey – Writing Functions in Java Today I practiced how to create functions (methods) in Java, and I built a simple program to check whether a number is Even or Odd. 🔥 What I learned today: ✔ How to create a boolean function ✔ How to use if-else conditions inside a method ✔ How to return true/false ✔ How to call a method inside the main() function ✔ How to print the result in the console 🧩 Example I worked on: I created a method IfEven(int a) that: Prints whether the number is Even or Odd Returns a boolean value (true for even, false for odd) This helped me understand functions more clearly and how they improve code structure and reusability. #Java #LearningJourney #100DaysOfCode #Coding #Developer #JavaBeginners #OOP #CodeNewbie
To view or add a comment, sign in
-
-
✨ I’m happy to share that today I learned the core concepts of Object-Oriented Programming (OOPs) in Java by implementing 🚀OOPs Pillars Explained in a Single Program practical way by implementing all concepts in a single Java program. 📌 OOPs Pillars: 🔹 Encapsulation Binding data (variables) and methods into a single unit (class) and restricting direct access using access modifiers. 🔹 Inheritance Acquiring properties and behaviors from one class to another using the “extends” keyword. Helps in code reusability. 🔹 Polymorphism One method, multiple behaviors. Achieved using method overloading and method overriding. 🔹 Abstraction Hiding implementation details and showing only essential features using abstract classes and interfaces. 📌 Key Understanding: Instead of learning concepts individually, implementing all OOPs pillars in one program gives a clear picture of how they work together in real-world applications. 💡 This is the core foundation of Java and essential for building scalable applications. #CoreJava #OOPsConcepts #JavaLearning #Programming #TapAcademy #LearningJourney #DeveloperSkills
To view or add a comment, sign in
-
-
Today I Learned: Java Interfaces Today I deep-dived into one of the most important OOP concepts in Java — Interfaces. An interface is like a contract that tells a class what to do, but not how to do it. This concept plays a huge role in writing clean, scalable, and maintainable code. 🔹 Key takeaways: ✅ Interfaces help achieve 100% abstraction ✅ They support multiple inheritance in Java ✅ Promote loose coupling between classes ✅ Interface methods are public & abstract by default ✅ Variables inside interfaces are public, static & final (constants) ✅ From Java 8 → Interfaces can have default & static methods ✅ From Java 9 → Interfaces can have private methods #interface #Java #Programming #OOP #Encapsulation #Coding #Developer #SoftwareEngineering #Learning #Tech #JavaDeveloper #Java #OOP #Inheritance #Programming #Coding #JavaDeveloper #Learning #InterviewPrep #Java #JavaProgramming #JavaDeveloper #SoftwareDevelopment #Programming #Coding #BackendDevelopment #TechLearning #Developers #LearnToCode #ProgrammingCommunity #100DaysOfCode #CodeNewbie #TechCareer #SoftwareEngineer
To view or add a comment, sign in
-
-
Today’s learning and revising ✨ Dived deep into one of the most fundamental concepts in Java — Variables. 🔹 What is a Variable? A variable is a named memory location used to store data that can change during program execution. 🔹 How JVM allocates memory? JVM divides memory mainly into Stack 🧱 and Heap 🌐 Stack → Stores method calls & local variables Heap → Stores objects & instance variables Memory is efficiently managed using stack frames and garbage collection 🔹 Types of Variables in Java: 1️⃣ Local Variable Declared inside methods Stored in stack memory No default values 2️⃣ Instance Variable Declared inside class but outside methods Stored in heap memory Each object has its own copy 3️⃣ Static Variable (Class Variable) Shared among all objects Allocated once in method area 💡 Key takeaway: Understanding variables is not just syntax — it’s about how memory works behind the scenes and how efficiently we use it. #Java #FullStackDevelopment #LearningJourney #JVM #Programming
To view or add a comment, sign in
-
-
🚀 Want to understand how ArrayList really works in Java? In this short video, I break down the basics of the List interface and show how ArrayList handles: ✅ adding elements ✅ resizing when full ✅ inserting at a specific index ✅ removing elements ✅ fast access with get(i) A simple visual explanation of one of the most used data structures in Java. Perfect for beginners, students, and anyone sharpening their DSA fundamentals. 💡☕ #Java #ArrayList #DataStructures #Algorithms #Programming #SoftwareDevelopment #Coding #JavaDeveloper #LearnToCode #ComputerScience #DSA #BackendDevelopment #Developers #TechEducation #CodeNewbie
Java ArrayList Explained in 45 Seconds
To view or add a comment, sign in
-
Learning Polymorphism in Java Today I explored one of the core concepts of OOPs – Polymorphism. It allows a single method to perform multiple behaviors depending on the object. 🔹 Covered: Compile-time polymorphism (Method Overloading) Runtime polymorphism (Method Overriding) Real examples with Java code Understanding this concept improves code flexibility, reusability, and scalability. 📘 Sharing my handwritten notes + examples for better understanding. #Java #OOP #Polymorphism #Programming #CodingJourney #Learning #JavaDeveloper #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Day 47 of My Learning Journey – Java Wrapper Classes Today, I explored Wrapper Classes in Java, an important concept that bridges primitive data types and objects. 🔍 What I Learned: ✔️ Wrapper classes convert primitive data types into objects ✔️ Each primitive type has a corresponding wrapper class (e.g., int → Integer, char → Character, double → Double) ✔️ Enables use of primitives in collections like ArrayList 💡 Key Concepts: 🔹 Autoboxing – Automatic conversion of primitive to object 🔹 Unboxing – Converting object back to primitive 🔹 Useful methods like parseInt(), toString(), and valueOf() 📊 Why It Matters: Wrapper classes make Java more flexible by allowing primitives to be treated as objects, especially when working with frameworks and collections. 📌 Example Use Case: Storing integers in an ArrayList using Integer instead of int. 🎯 Takeaway: Understanding wrapper classes is essential for writing efficient and modern Java programs. #Java #LearningJourney #Programming #Day47 #TechSkills #Developers #Coding
To view or add a comment, sign in
-
-
🚀 Day 16/45 – Understanding Abstraction in Java On Day 16 of my Java learning journey, I explored Abstraction, one of the core principles of Object-Oriented Programming. Abstraction focuses on hiding implementation details and showing only the essential functionality to the user. 📚 What I Learned Today Today I learned: ✔ What abstraction is and why it is important ✔ How to use abstract classes in Java ✔ Understanding abstract methods (methods without body) ✔ How abstraction works with inheritance 💻 Practice Work To apply my learning, I implemented: • An animal example using abstract class • A shape example demonstrating abstraction 🎯 Key Takeaway Abstraction helps simplify complex systems by hiding unnecessary details and focusing on what is important. It plays a key role in building clean and scalable applications. Step by step, I am gaining a deeper understanding of OOP concepts. #Java #Programming #LearningInPublic #CodingJourney #SoftwareDevelopment #OOP
To view or add a comment, sign in
-
Most developers start with Java by writing code but the real clarity comes when you understand what is happening underneath Swipe through this This is how I started looking at Java beyond just syntax In the beginning I focused on writing programs that work loops classes functions done but things started making more sense when I looked deeper how JVM actually executes code why OOP is more than just theory how memory is managed through stack and heap what really happens in collections and multithreading and why garbage collection matters more than we think The more I learn, the more I realise strong fundamentals make everything else easier frameworks tools and systems all build on this Still learning and going deeper into core concepts What part of core Java took you the most time to understand #Java #CoreJava #BackendDevelopment #SoftwareEngineering #Programming #JavaDeveloper
To view or add a comment, sign in
-
-
Most developers start with Java by writing code but the real clarity comes when you understand what is happening underneath Swipe through this This is how I started looking at Java beyond just syntax In the beginning I focused on writing programs that work loops classes functions done but things started making more sense when I looked deeper how JVM actually executes code why OOP is more than just theory how memory is managed through stack and heap what really happens in collections and multithreading and why garbage collection matters more than we think The more I learn, the more I realise strong fundamentals make everything else easier frameworks tools and systems all build on this Still learning and going deeper into core concepts What part of core Java took you the most time to understand #Java #CoreJava #BackendDevelopment #SoftwareEngineering #Programming #JavaDeveloper
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