🚀 Learning Java – Understanding the Static Keyword Today I completed the "Static" concept in Java on TAP Academy. In Java, the keyword static is used for variables, methods, blocks, and nested classes. It means the member belongs to the class, not to individual objects. 1️⃣ Static Variable (Class Variable) A variable declared with static is shared by all objects of the class. Only one copy exists in memory. 2️⃣ Static Method A method declared as static can be called without creating an object. It can only directly access static variables and static methods. 3️⃣ Static Block Used for initializing static variables. It runs only once when the class is loaded. 4️⃣ Static Nested Class A class declared inside another class with static. It can access only static members of the outer class. #Java #Programming #Learning #TAPAcademy #SoftwareDevelopment #BTechStudent
Java Static Keyword Explained
More Relevant Posts
-
Day 9 – Java Learning Journey Today I continued strengthening my Java fundamentals, focusing on method overriding and important rules in inheritance. Key concepts I explored: • Method Overriding Rules in Java The child class method must have the same method signature as the parent class method. The return type must be the same or covariant (a subclass of the parent return type). The method cannot be static, because static methods belong to the class rather than the object. • Covariant Return Types Java allows a child class method to return a more specific type than the parent class method, making inheritance more flexible. • Static vs Instance Methods I also learned why static methods cannot be overridden and are instead method hidden, which behaves differently from runtime polymorphism. Step by step, continuing to build a stronger foundation in Core Java and OOP concepts. 🚀 #Java #CoreJava #OOP #MethodOverriding #Programming #SoftwareDevelopment #LearningJourney
To view or add a comment, sign in
-
🚀 Starting My Java Learning Journey – Day 14 🔹 Topic: Final Keyword & Static Keyword in Java In Java, final and static are important keywords used to control behavior of variables, methods, and classes. ✅ Final Keyword The final keyword is used to restrict modification. ✔ final variable → value cannot be changed ✔ final method → cannot be overridden ✔ final class → cannot be inherited ✅ Static Keyword The static keyword is used for memory management and sharing data. ✔ Belongs to the class, not objects. ✔ Shared among all objects. ✔ Can be accessed without creating an object. 💡 Key Points: ✔ final → restricts changes ✔ static → shared among all objects #Java #JavaLearning #Programming #BackendDevelopment #CodingJourney #JavaFinal #JavaStatic
To view or add a comment, sign in
-
🚀 Day 73/100 of My Java Programming Series ☕💻 Today, I learned and practiced Method Overloading in Java — an important concept of compile-time polymorphism. 📌 What I explored today: ✅ What is Method Overloading ✅ Same method name with different parameters ✅ Changing number of arguments ✅ Changing data types of arguments ✅ Improving code readability and reusability ✅ Real-time examples for better understanding 💡 Key takeaway:Method Overloading allows us to define multiple methods with the same name but with different parameter lists. It helps make programs more flexible, organized, and easier to understand. 🧠 This concept is very useful in writing cleaner code and understanding how Java supports polymorphism. 🔥 Day 73 completed. Still learning, still growing! #Java #JavaProgramming #OOP #MethodOverloading #Polymorphism #100DaysOfCode #CodingJourney #Programming #SoftwareDevelopment #JavaDeveloper #LearningJourney10000 Coders Meghana M
To view or add a comment, sign in
-
🚀 Starting My Java Learning Journey – Day 8 🔹 Topic: Methods in Java A method is a block of code that performs a specific task. Methods help make programs organized, reusable, and easier to read. returnType – type of value the method returns (use void if it returns nothing) methodName – name of the method parameters – input values the method takes 📌 Example Program public class Main { // Method to add two numbers static int addNumbers(int a, int b) { return a + b; } public static void main(String[] args) { int sum = addNumbers(10, 20); System.out.println("Sum: " + sum); } } Output: Sum: 30 💡 Key Points: Methods avoid code repetition Methods can take inputs (parameters) and return outputs Helps in modular programming #Java #JavaLearning #Programming #BackendDevelopment #CodingJourney #JavaMethods
To view or add a comment, sign in
-
🚀 Day 9/45 – Understanding Methods in Java On Day 9 of my Java learning journey, I explored the concept of Methods (Functions), which are essential for writing reusable and organized code. Methods help reduce repetition and make programs easier to understand and maintain. 📚 What I Learned Today Today I learned: ✔ What methods are and why they are used ✔ How to define and call methods ✔ Passing parameters to methods ✔ Returning values from methods 💻 Practice Work To apply my learning, I implemented: • A method to print a message • A method to perform addition • A method to check whether a number is even or odd 🎯 Key Takeaway Methods are a powerful feature in programming that promote code reusability and modular design. Understanding methods is an important step toward mastering advanced concepts like object-oriented programming. #Java #Programming #LearningInPublic #javadeveloper #CodingJourney #SoftwareDevelopment #Consistency
To view or add a comment, sign in
-
🚀 Java Learning Journey – Day 5 Why Java Says "No" to Multiple Inheritance (and "Yes" to Interfaces) 💎 Ever wondered why Java doesn't allow a class to inherit from two parents? It all comes down to the Diamond Problem. When two parent classes have the same method, the compiler gets confused: "Which one should I use?" To keep things clean and prevent bugs, Java blocks this at the class level. But wait—you can still achieve the same goal! 💡 By using Interfaces, you get the flexibility of multiple inheritance without the ambiguity. Check out this quick visual guide I put together to break it down. 👇 #Java #Programming #ObjectOrientedProgramming #SoftwareDevelopment #CodingTips #TechCommunity
To view or add a comment, sign in
-
-
Day 8 of My Java Learning Journey ☕💻 Today I continued strengthening my core Java fundamentals and focused on understanding Method Overloading and basic Inheritance concepts. What I practiced today: • Implemented method overloading by creating an Area Calculator for Square, Rectangle, and Circle • Learned how Java decides which method to call at compile time (Compile-Time Polymorphism) • Practiced taking user input using the Scanner class • Explored the basics of Inheritance using parent and child classes • Understood how child classes can access methods from parent classes One key takeaway today: Writing small programs helps reinforce concepts much better than just reading theory. Next on the learning roadmap: • Method Overriding • Runtime Polymorphism • Deeper understanding of Object-Oriented Programming in Java Step by step, building stronger backend fundamentals. #Java #LearningInPublic #Programming #BackendDevelopment #100DaysOfCode #JavaDeveloper
To view or add a comment, sign in
-
📘 Day 23 of My Java Learning Journey Today I explored one of the core concepts of Object-Oriented Programming, Inheritance in Java 💡 🔹 Inheritance represents an “is-a relationship” 🔹 It allows one class to acquire properties and behaviors of another 🔹 It helps in code reusability and reduces code duplication 📚 I covered the following types of inheritance: • Single Inheritance • Multilevel Inheritance • Hierarchical Inheritance ⚠️ I learned about Multiple Inheritance and the Diamond Problem, but since Java doesn’t support it using classes, it is achieved using interfaces. 👉 I’ve decided to skip Multiple and Hybrid Inheritance for now and will revisit them after completing Interfaces for better clarity. 💻 I also implemented example programs with proper code and output to strengthen my understanding. Step by step, building a strong foundation in Java 💪 #JavaDeveloper #CoreJava #ObjectOrientedProgramming #JavaLearning #CodeNewbie #DeveloperJourney #LearnToCode #ProgrammingLife #FutureDeveloper
To view or add a comment, sign in
-
🚀 Exploring Java Collection Framework Today’s session was all about understanding the powerful Java Collection Framework and how it helps in managing and organizing data efficiently. Dived deep into core concepts like interfaces and classes in collections, and explored the three main interfaces: List, Set, and Map. Gained clarity on how these structures differ and where to use them in real-world applications. Focused on the ArrayList class—its properties like dynamic resizing, ordered storage, and index-based access—making it one of the most commonly used collection classes in Java. Also understood the hierarchy of ArrayList, how it is part of the List interface, and how it inherits behavior from abstract classes like AbstractList and AbstractCollection. 📚 A strong foundation in collections is essential for writing efficient and scalable Java applications. TAP Academy #Java #CollectionsFramework #ArrayList #Programming #LearningJourney #FullStackDevelopment
To view or add a comment, sign in
-
-
#Day35 – Abstraction in Java 🧠 Today’s session completely changed the way I look at Abstraction in Java. 🔹 Key Learnings: ✔ Abstraction → showing essential features while hiding implementation ✔ Achieved using abstract classes & methods ✔ Abstract class → cannot be instantiated ✔ Can contain both abstract & concrete methods ✔ Abstract methods must be overridden in child classes ✔ Constructors, static methods, and variables are allowed in abstract classes ✔ Abstract class can extend another class (abstract or normal) 💡 One interesting insight: Abstract doesn’t just exist in Java — it exists in our life journey too. Many things are unknown (abstract) today, and become concrete over time. Special thanks to TAP Academy, and mentor Harshit T sir for the constant guidance and motivation 🙌 #Java #OOPS #Abstraction #Programming #CodingJourney #Consistency #Learning #TapAcademy
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