While learning Java Full Stack Development at Codegnan IT Solutions, I explored how instance and static variables work — and understanding this helped me write cleaner, more efficient code. 💻 🔹 Instance Variable Or Non Static Variable – Belongs to an object. Each object has its own copy, and it’s created when the object is instantiated. 🧠 Scope: Within the object. ⏳ Lifetime: Exists until the object is destroyed. 🔹 Static Variable – Belongs to the class, not the object. It’s shared among all objects and loaded once when the class is loaded into memory. 🧠 Scope: Throughout the class. ⏳ Lifetime: Until the program ends. Learning these small but powerful concepts makes a big difference in how we understand object-oriented programming. 🚀 Thanks to Anand Kumar BuddarapuSir for making Java concepts crystal clear during my sessions at Codegnan IT Solutions! 🙌 #Java #Codegnan #FullStackDeveloper #LearningJourney #Programming #OOPs
Understanding Instance and Static Variables in Java at Codegnan IT Solutions
More Relevant Posts
-
As part of my Full Stack Java training at Codegnan IT Solutions, I recently explored how Local Variables and Static Blocks work in Java — and they’re quite interesting! 🔹 Local Variable A local variable is declared inside a method, constructor, or block. It is created when the method is called and destroyed once the method exits. 👉 Local variables must be initialized before use, and they cannot be accessed outside their scope. 🔹 Static Block A static block is used to initialize static data members. It runs only once, when the class is loaded into memory — even before the main() method executes. Every new concept in Java helps me understand how the language is both powerful and well-structured. Big thanks to Anand Kumar Buddarapu Sir for his detailed and practical explanations at Codegnan IT Solutions! 🙌 #Java #Codegnan #FullStackDeveloper #LearningJourney #Programming #JavaConcepts #OOPs
To view or add a comment, sign in
-
-
Week 6 | Day 1, we explored how Java inheritance evolves step by step — from basics to real-world structure! 🚀 🔹 Version 1: Built the base with simple inheritance — Manager extending Employee with getters, setters, and getDetails(). Understood how constructors are called in order (parent first, then child). 🔹 Version 2: Added parameterized constructors and constructor chaining using super(). This made object creation organized and showed how initialization flows between classes. 🔹 Version 3: Introduced a bonus() method — learning how child classes can extend or override parent behavior. A first look at polymorphism in action. Each version made the concepts feel more connected and purposeful — learning by coding, not just reading! Thanks to out mentor Anand Kumar Buddarapu sir :) #Java #Inheritance #OOPs #FullStackDevelopment #LearningJourney #Codegnan
To view or add a comment, sign in
-
#120DaysOfCodingChallenge — on the topic Constructor Chaining in Java 👇 🚀 #Day20 of my #120DaysOfCodingChallenge in #JavaFullStack at #DestinationCodegnan! Today, I learned on the topic Constructor Chaining in Java 👇 — a key concept in Object-Oriented Programming that enhances code reusability and efficiency ⚙️💡 📌 What I Learned: 👉 Constructor Chaining is the process of calling one constructor from another within the same class or from a parent class using the keywords this() and super(). 👉 It helps avoid code duplication by allowing constructors to reuse initialization logic. 👉 It improves readability and maintainability, ensuring smoother object creation flow. 💡 Real Use Case: Constructor Chaining is often used when creating multiple constructors with different parameters — allowing one constructor to delegate common setup tasks to another. This concept deepened my understanding of inheritance, constructor overloading, and how Java efficiently manages object initialization. Grateful to my mentor Anand Kumar Buddarapu, and appreciation to Uppugundla Sairam (Founder) and Saketh Kallepu (Co-Founder) for their constant support and motivation at #DestinationCodegnan 🙌 #Java #FullStackDevelopment #Codegnan #LearningJourney #Day20 #JavaProgramming #ConstructorChaining #CodingChallenge #ObjectOrientedProgramming #120DaysOfCode
To view or add a comment, sign in
-
-
#Day13 — Understanding the Difference Between “this” and “super” Keywords 🧠💻 Today, I explored another important concept in Java — the difference between “this” and “super” keywords. Both play a crucial role in object-oriented programming: - "this" refers to the current class object - "super" calls the parent class method or constructor Learning how they work helps in writing cleaner, more maintainable, and well-structured code. Grateful to my mentor Anand Kumar Buddarapu for the constant support and guidance that makes these concepts easier to understand. Saketh Kallepu Uppugundla Sairam & Codegnan #Java #OOPs #LearningJourney #CodegnanLearner #CodingJourney #Day13 #ProgrammingConcepts #Mentorship #Gratitude
To view or add a comment, sign in
-
-
🚀 #Day26 of my #120DaysOfCodingChallenge in #JavaFullStack at Destination Codegnan! 🎯 Today’s Concept: Interfaces in Java An interface in Java defines a contract of methods that a class must follow. It focuses on what needs to be done, leaving the how to the implementing classes. Interfaces play a key role in achieving abstraction, loose coupling, and multiple inheritance in Java. 💡 Key Points I Learned: 🔹 Interfaces contain method declarations (by default, abstract) and constant variables. 🔹 A class uses the implements keyword to provide its own implementation. 🔹 A class can implement multiple interfaces, supporting flexible and scalable design. 🔹 Interfaces help ensure consistency across different implementations. 🧠 Learning Outcome: Interfaces are crucial for designing clean and modular architectures. They allow different classes to share a common behavior blueprint while still having the freedom to implement functionalities in their own way. This leads to better maintainability, testability, and scalable code structures in real-world applications. 🙏 Grateful to my mentor Anand Kumar Buddarapu Sir of Codegnan for the constant guidance and motivation 🙌 #Java #InterfacesInJava #OOPS #JavaFullStack #Codegnan #LearningJourney #JavaProgramming #120DaysOfCodingChallenge #TechGrowth #ConsistencyWins
To view or add a comment, sign in
-
💡 Understanding Inheritance in Java! In object-oriented programming, inheritance allows a class (subclass) to acquire the properties and methods of another class (superclass). Here’s a simple example 👇 🟦 Superclass: Company – defines a general work() method. 🟩 Subclass: Employee – extends Company and overrides the work() method to provide its own behavior. 🔁 This concept helps in code reusability and method overriding, making programs easier to maintain and extend. #Java #OOPs #Inheritance #LearningJava #Coding #Developers #JavaProgramming ✨ Grateful to my mentor Anand Kumar Buddarapu and Codegnan Institute for helping me deeply understand these concepts and guiding my learning journey. Saketh Kallepu & Uppugundla Sairam
To view or add a comment, sign in
-
-
💻 Java Practice: Nested If-Else Example Hey LinkedIn family! 👋 Today I practiced Nested If-Else statements in Java — a powerful concept that helps make decisions within decisions. ✅ Key Takeaways: 1.Nested If-Else helps handle multi-level decision making. 2.Always validate inputs before using them in logic. 3.Great example of real-life condition checking (like voting eligibility). 4.Improves understanding of control flow and logical structuring. 5.Encourages clean and readable coding style. 6.Builds confidence for writing complex conditional programs. #Java #Programming #LearningJourney #NestedIfElse #CodingPractice #JavaDeveloper Grateful to my mentor Anand Kumar Buddarapu Sir for constantly motivating us to learn and grow in our coding journey. 🌱 Thanks to Codegnan Saketh Kallepu Sir Uppugundla Sairam Sir
To view or add a comment, sign in
-
-
Inheritance in Java – The Power of Reusability! Inheritance is a key pillar of Object-Oriented Programming (OOP). It lets one class (subclass) reuse and extend the features of another (superclass) — saving time, reducing repetition, and keeping our code clean! In my example 👇 🟦 Superclass: Animal → eat() method 🟩 Subclass: Dog → inherits eat() and adds its own bark() With inheritance, the Dog not only learns to eat 🐾 but also adds its own voice 🐶 — that’s the true power of building on existing logic! ✨ Grateful to my mentor Anand Kumar Buddarapu and Codegnan Institute for helping me deeply understand these concepts and guiding my learning journey. 🙏 Saketh Kallepu & Uppugundla Sairam #Java #OOP #Inheritance #Codegnan #LearningJourney #ProgrammingConcepts #Mentorship #Developers #Coding
To view or add a comment, sign in
-
-
Understanding this and super in Java — A Key OOP Concept Today, I explored one of the most fundamental concepts in Java: the difference between the this and super keywords. Using a simple class hierarchy example (Animal → Dog), I visualized how: 🔹 this refers to the current class object 🔹 super refers to the parent class object It was exciting to see how both help in accessing variables and methods across inheritance levels — a clear way to strengthen my understanding of Object-Oriented Programming. ✨ Key takeaway: this helps you work within the current class, while super helps you connect beyond it. A big thank you to my mentor Anand Kumar Buddarapu and the Codegnan team for guiding me through these Java fundamentals and helping me learn. Saketh Kallepu & Uppugundla Sairam #Java #OOP #LearningJourney #Codegnan #Programming #thisKeyword #superKeyword #JavaDeveloper
To view or add a comment, sign in
-
-
🌟 Day 48 of #100DaysOfCode with Codegnan 🌟 The journey through the Java Collections Framework continued today! We explored more of the List interface and then ventured into the world of Set. 🧑💻 Java Programming Journey 🧑💻 LinkedList: The Dynamic List ⛓️ First, we learned about LinkedList. Unlike ArrayList, which is backed by an array, a LinkedList stores elements as nodes, each pointing to the next (and previous). This makes it incredibly fast for adding and removing elements from the middle of the list. Set Interface: No Duplicates Allowed! ⛔ Next, we moved to the Set interface, a collection that, by definition, cannot contain duplicate elements. This is its defining feature! We explored its three main implementations, and the difference is all about order: HashSet: Order: Unordered. It uses hashing for storage, so the order is unpredictable. Speed: The fastest for adding and checking ( contains()) elements, thanks to hashing. Duplicates: Not allowed. LinkedHashSet: Order: Maintains insertion order. Elements are stored in the order they were added. Speed: Nearly as fast as HashSet. Duplicates: Not allowed. TreeSet: Order: Sorted order. Elements are automatically sorted in their natural order (or by a custom comparator). Speed: Slower, as it needs to maintain the sorted order (uses a tree structure). Duplicates: Not allowed. Practice and Application 💡 We practiced the specific methods for LinkedList and then focused on HashSet, adding elements and observing how it automatically handles duplicates. Key Takeaway: The collection you choose is critical. Need a resizable array? ArrayList. Need fast insertions/deletions? LinkedList. Need to store unique items? Set. Need them unsorted and fast? HashSet. Need them in insertion order? LinkedHashSet. Need them sorted? TreeSet. Understanding these differences is key to writing efficient code! 🚀 #100DaysOfCode #Java #CollectionsFramework #DataStructures #LinkedList #Set #HashSet #LinkedHashSet #TreeSet #Codegnan #ProblemSolving Mentors: Levaku Lavanya Ma'am, Saketh Kallepu Sir, Uppugundla Sairam Sir
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