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
Learning Local Variables and Static Blocks in Java at Codegnan
More Relevant Posts
-
🌈 Day 24 of My Java Learning Journey 🎊🏅 🔥 Access Modifiers in Java The Gatekeepers of Your Code! 🚪☕ Ever wondered how Java controls who can access what in your code? That’s where Access Modifiers step in they’re like security guards 🧱 standing at different levels of your Java application. Let me explain simply 👇 Java has four main access levels: 🔹 public - Accessible from anywhere in the project. 🔹 protected - Accessible within the package and by subclasses (even in other packages). 🔹 default (no keyword) - Accessible only within the same package. 🔹 private - Accessible only inside the same class. 💡 When I first started coding, I made every class and variable public 😅. One day, a bug from another class changed my variable’s value that’s when I realized the power of access control! ✨ The beauty of access modifiers? They help keep your code secure, modular, and easy to maintain. 🔚 Keep learning, keep securing your code that’s how you grow from writing code to building systems. 💻💪 #Java #AccessModifiers #JavaLearning #CodingJourney #BackendDevelopment #JavaDeveloper #OOP #CodeSecurity #LearnInPublic #100DaysOfCode #TechCareer #ProgrammingTips #SoftwareEngineering #DevelopersJourney #CodeBetter #JavaProgramming #CleanCode #SpringBoot #BackendEngineer #Maang #Consistency #Motivation #Hustle #Google #CarrierGoal
To view or add a comment, sign in
-
-
🌟 Understanding the Difference Between extends and implements in Java In Java, both extends and implements are used for inheritance, but they serve different purposes depending on whether we are dealing with classes or interfaces. 🔹 extends Used when a class inherits another class, or an interface inherits another interface. Supports single inheritance. Helps in reusing existing code. 🔹 implements Used when a class implements an interface. The class must define all abstract methods declared in the interface. Supports multiple inheritance. implements 💡 Simple Tip: 👉 extends → inherits behavior 👉 implements → defines behavior Special thanks to my mentors Anand Kumar Buddarapu for their constant support and guidance in helping me understand core Java OOP concepts. Your mentorship means a lot! #Java #OOP #Programming #Extends #Implements #Learning #Mentorship #Thankful #Codegnan
To view or add a comment, sign in
-
-
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
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
-
-
During my Full Stack Java training at Codegnan IT Solutions, I recently learned about one of the most essential parts of any Java program — the public static void main(String[] args) method. It might seem like just a single line of code, but every keyword in it plays a crucial role in how Java runs your program 👇 🔹 public The public keyword makes the main() method accessible from anywhere. Since the JVM (Java Virtual Machine) needs to start the program from outside the class, the method must be declared public. 🔹 static static lets the JVM call this method without creating an object. When the program first runs, no objects exist yet — so the method needs to be accessible in a static way. 🔹 void This means the method doesn’t return any value. After the instructions inside it execute, the program simply finishes. 🔹 main This is the entry point of every Java program. The JVM specifically looks for a method named main() to begin execution — changing the name would stop your program from running. 🔹 (String[] args) This part allows the program to receive input from the command line. args is an array of strings that stores those command-line arguments. 💡 In a nutshell: public static void main(String[] args) is not just a formality — it’s how the JVM connects with and runs your Java code. Each keyword serves a specific purpose to make program execution possible. A big thanks to Anand Kumar Buddarapu Sir for explaining these concepts so clearly and making learning Java so enjoyable! 🙏 #Java #Programming #FullStackDevelopment #Codegnan #LearningJava #TechTraining #CodingJourney #SoftwareDevelopment #JavaLearning
To view or add a comment, sign in
-
-
🚀 Leveling up my Java skills with Generics! Today, I explored one of the most powerful concepts in Java — Generics, which helps in achieving type safety, cleaner code, and better compile-time checks. To strengthen my understanding, I created 30 practice programs covering: 🔹 Generic Classes 🔹 Generic Methods 🔹 Type Bounds (extends, super) 🔹 Wildcards (?, ? extends, ? super) 🔹 Multiple Bounds 🔹 API-style generic entities 🔹 Compile-time safety examples These practice snippets helped me understand how Generics work behind the scenes and why they are so important in modern Java development. 📄 I’ve also compiled all programs into a clean Word document for easy reference. If you're learning Java, I highly recommend practicing Generics — it improves your code quality and makes you think in a more structured way. #Java #Programming #Learning #Generics #SoftwareDevelopment #100DaysOfCode #JavaLearning #CodingJourney #BackendDevelopment . . . . Proud to be trained by Learn2Earn Labs (www.learntoearnlabs.com) — where learning meets real-world industry exposure
To view or add a comment, sign in
-
Today, I explored and organized all the important String methods in Java — a fundamental yet powerful concept that every developer must understand. Strings in Java are immutable, meaning once created, they cannot be changed — but Java provides a wide range of methods to manipulate, compare, and analyze them effectively. Here’s a quick summary of what I covered 👇 🔹 Comparison methods — equals(), compareTo() 🔹 Case conversion — toUpperCase(), toLowerCase() 🔹 Length & character operations — length(), charAt() 🔹 Substrings — substring(), split() 🔹 Modify & replace — replace(), trim(), replaceAll() 🔹 Validation — contains(), isEmpty(), startsWith() 🔹 Conversion — toCharArray(), valueOf(), join(), concat() I also created this color-coded visual 📊 to help beginners remember the methods easily and revise them faster! Big thanks to my mentor Anand Kumar Buddarapu and Codegnan for guiding me through every concept and helping me build a strong foundation in Java Saketh Kallepu & Uppugundla Sairam. #Java #StringHandling #LearningJava #Codegnan #OOPs #Programming #Mentorship #JavaDeveloper #LearnCoding
To view or add a comment, sign in
-
-
💡 Call by Value vs Call by Reference. Today I learned one of the most important and commonly asked Java concepts — Call by Value vs Call by Reference. This helped me clearly understand how data is passed inside methods and why sometimes the original value changes and sometimes it doesn’t. In short: 📄 Call by Value → Sends a copy of the data (original value stays same) 🔗 Call by Reference → Sends the address (changes reflect on the original object) This simple visual makes the concept easy to understand even for beginners! A big thanks to my mentor Anand Kumar Buddarapu for guiding me patiently, and to Codegnan for helping me strengthen my Java fundamentals. 🙏 Uppugundla Sairam & Saketh Kallepu. #Java #Codegnan #LearningJourney #FullStackDevelopment #ProgrammingConcepts #Beginners #CallByValue #CallByReference #JavaLearning
To view or add a comment, sign in
-
-
As part of my Full Stack Java training at Codegnan IT Solutions, I recently explored one of the most fundamental and important parts of Java — the public static void main(String[] args) method. It might look like a long line of code, but every keyword here has a specific meaning and purpose. Let’s break it down 👇 🔹 public The keyword public makes the main() method accessible from anywhere. The JVM (Java Virtual Machine) needs to access this method from outside the class to start program execution — that’s why it must be declared public. 🔹 static The keyword static allows the JVM to call the method without creating an object of the class. This is essential because when the program starts, no objects exist yet — so the method must be callable in a static way. 🔹 void The keyword void specifies that the main() method does not return any value. Once the code inside it executes, the program simply terminates. 🔹 main This is the method name recognized by the JVM as the entry point of any Java application. If you change this name, the program won’t start because the JVM looks specifically for a method named main. 🔹 (String[] args) This part allows the program to accept input from the command line when it starts. args is an array of String objects that stores those command-line arguments. 💡 In Summary: public static void main(String[] args) is not just a rule — it’s the gateway through which the JVM interacts with your code. Each keyword ensures that Java can locate, access, and run your program efficiently. A big thank you to Anand Kumar Buddarapu Sir for explaining every concept so clearly! 🙏 #Java #Programming #FullStackDevelopment #Codegnan #LearningJava #TechTraining #CodingJourney #SoftwareDevelopment #JavaLearning
To view or add a comment, sign in
-
-
🚀 Java Learning: Understanding the Difference Between this and super Keywords In Java, both this and super are important keywords — but they serve very different purposes 👇 🟦 this → Refers to the current class instance. 🟪 super → Refers to the immediate parent class and is often used to call parent class methods or constructors. 💡 These concepts are fundamental for mastering inheritance and method overriding in Java. Understanding how this and super work helps in writing clean, efficient, and bug-free object-oriented code! #Java #Programming #OOP #LearningJava #Developers #CodeLearning ✨ 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
-
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