💻 Understanding public static void main(String[] args) in Java Every Java program starts its journey from this line — but do you know what each word really means? Let’s break it down 👇 public → The method is accessible from anywhere. The JVM needs to access this method to start your program. static → Belongs to the class, not an object. So the JVM can call it without creating an object. void → It doesn’t return any value. Once the execution is done, the program just ends. main → The entry point of every Java program. Execution starts from here. String[] args → Used to take command-line arguments. You can pass inputs while running your program. #Java #Programming #Coding #CodeWithPassion #Java 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
Understanding Java's public static void main(String[] args)
More Relevant Posts
-
✨ Ever wondered why every Java program begins with public static void main(String[] args)? It’s not just a random line it’s the heart of your Java code! 💻 👉 public makes it visible to the JVM. 👉 static means it runs without creating an object. 👉 void tells Java there’s nothing to return. 👉 main() is the starting point of execution. 👉 String[] args lets you take input from the user. Think of it like pressing START on your program 🚀 That’s when Java knows where to begin running your logic! 💬 Comment below which Java concept you want us to break down next! ❤️ If you liked this post, follow @Crio.Do for more bite-sized Java and coding explainers that make learning fun & simple! #JavaProgramming #LearnJava #CodingBasics #CrioDo #JavaForBeginners #ProgrammersLife #CodeNewbie #SoftwareEngineering #JavaConcepts #PublicStaticVoidMain
To view or add a comment, sign in
-
A Quick Glance at Method Overloading in Java ⚙️ Today, I explored another key concept of Object-Oriented Programming — Method Overloading, which helps us achieve compile-time polymorphism. I’ve organized everything in one page for better understanding and revision 📝 Here’s what my notes include 👇 ✨ 1️⃣ Definition ✨ 2️⃣ Example ✨ 3️⃣ Why We Need It ✨ 4️⃣ Rules ✨ 5️⃣ Code Implementation ✨ 6️⃣ Working Mechanism ✨ 7️⃣ Type Promotion ✨ 8️⃣ Ambiguity Error ✨ 9️⃣ Different Names Grateful to TAP Academy and mentors kshitij kenganavar, Sharath R, Harshit T for helping me build a strong foundation in Java step by step 🙌 #Java #MethodOverloading #CompileTimePolymorphism #OOPsConcepts #JavaNotes #TAPAcademy #FullStackDeveloper #LearningJourney #CodeWithClarity #HandwrittenNotes #CodingCommunity
To view or add a comment, sign in
-
-
🚀 Say goodbye to NullPointerExceptions and hello to cleaner code! Using `OptionalT` in Java is a game-changer when it comes to handling the absence of values. It’s not just a fancy container; it’s a powerful way to convey the semantics of "might be there" directly in your API. By leveraging `Optional`, you can enhance your return types and use it judiciously in method parameters, making your code more readable and less prone to errors. However, be cautious! Overusing `Optional` for fields or parameters can lead to unnecessary boilerplate. Stick to common patterns like `orElse`, `orElseGet`, `ifPresent`, `map`, and `flatMap` to effectively transform nested optionals without cluttering your code. What small refactoring helped you reduce null checks in your code? Share your tips below! #Java #JavaConcept #Programming #SoftwareEngineering #JavaTips
To view or add a comment, sign in
-
🎯 Demystifying “Call by Value” vs “Call by Reference” in Java One of the most common misconceptions among developers is that Java supports Call by Reference. In reality, Java is strictly “Call by Value” — but with a subtle twist. 🔹 For Primitive Types: A copy of the actual value is passed to the method. Any modification inside the method does not affect the original variable. 🔹 For Object Types: A copy of the reference (memory address) is passed, not the actual object. Hence, while the reference itself is not altered, the object it points to can still be modified. In essence, Java passes a copy of the reference by value — a concept that often leads to confusion but is crucial for mastering memory behavior and object manipulation. Big thanks to my mentors Anand Kumar Buddarapu Sir, Saketh Kallepu sir, Uppugundla Sairam Sir & Codegnan for their guidance and for pushing me to consistently tackle tougher problems! #Java #SoftwareDevelopment #ProgrammingConcepts #ObjectOrientedProgramming #TechLearning #Developers #CodeWithClarity #ProgrammingInsights
To view or add a comment, sign in
-
-
🚀 Java Min-Max Sum Challenge | Speed Coding Practice Today, I practiced an interesting Java problem that helped me strengthen my understanding of loops, arrays, and basic algorithmic logic. 🧩 Problem Statement: Given an array of n integers, find the minimum and maximum sums that can be obtained by adding exactly n−1 elements. In simple terms — for each element, calculate the sum of all other elements and then print the smallest and largest of those sums. Example: Input → 1 2 3 4 5 Output → 10 14 This exercise really helped me: Improve my logic-building and problem decomposition skills 🧠 Practice nested loops and array traversal in Java 🔁 🎥 I’ve attached a short speed coding video of my implementation — showcasing how I approached, reasoned, and wrote the code step-by-step. I’m enjoying learning Java by solving such small but powerful logic-based problems every day! #Java #CodingPractice #ProblemSolving #ProgrammingJourney #LearningToCode #LinkedInCodingCommunity
To view or add a comment, sign in
-
Deep Dive into Encapsulation in Java 🔐 Today, I explored one of the core pillars of Object-Oriented Programming — Encapsulation, and connected it with all the important related concepts to gain a complete understanding. Here’s what my one-page note covers 👇 ✨ 1️⃣ Definition ✨2️⃣ How to Achieve Encapsulation ✨3️⃣ Shadowing Problem ✨4️⃣ Advantages ✨5️⃣ Constructors ✨6️⃣ Types of Constructors ✨7️⃣ Constructor Overloading & Constructor Chaining ✨8️⃣ POJO Class ✨9️⃣ this Keyword & this() Method Grateful to TAP Academy and mentors kshitij kenganavar, Harshit T , Sharath R for guiding me through these core Java concepts and helping me build strong programming fundamentals 🙌 #Java #Encapsulation #Constructors #ConstructorOverloading #ConstructorChaining #POJO #OOPsConcepts #TAPAcademy #LearningJourney #CodeWithClarity #FullStackDeveloper #JavaNotes #CodingCommunity
To view or add a comment, sign in
-
-
Understanding the Heart of Every Java Program — public static void main(String[] args) If you’ve ever written a Java program, you’ve definitely seen this line. But do you really know what each part means? 1️⃣ public — Accessible from anywhere. This allows the JVM (Java Virtual Machine) to access the method from outside the class. 2️⃣ static — Belongs to the class. It can be run without creating an object of the class. 3️⃣ void — No return value. This method doesn’t return anything to the JVM. 4️⃣ main — The program’s entry point. Execution starts here! It’s the launching pad for your Java rocket. 5️⃣ String args — Command-line inputs. Used to pass external arguments into the program during execution. Whenever you write a new Java program, remember — public static void main(String[] args) is where your journey begins #Java #Programming #Coding #LearnJava #SoftwareEngineering #CodeNewbie #DeveloperCommunity #OOP #JavaProgramming #SoftwareDevelopment #CodingForBeginners #ProgrammersLife #ComputerScience #BackendDevelopment #TechLearning #CodeWithMe
To view or add a comment, sign in
-
-
#Day14 — Exploring Java Casting ☕💻 Today, I learned about one of the core concepts in Java — Casting, which helps in converting one type of object reference into another within an inheritance hierarchy. 🔹 Upcasting (Implicit & Safe): Treating a subclass object as its superclass type — always safe and commonly used in polymorphism. 🔹 Downcasting (Explicit & Risky): Converting a superclass reference back to a subclass type — requires explicit casting and "instanceof" checks to avoid runtime errors. This concept deepened my understanding of type conversion, inheritance, and runtime behavior in Java. A heartfelt thank you to my mentor Anand Kumar Buddarapu for guiding me through these technical insights and making complex topics simpler to grasp. Uppugundla Sairam Saketh Kallepu & Codegnan #Java #OOPs #Downcasting #Upcasting #CodegnanLearner #CodingJourney #Day14 #ProgrammingConcepts #Mentorship #LearningInPublic
To view or add a comment, sign in
-
-
Revisiting Method Overloading in Java Today, I took some time to go back to one of the fundamental concepts of Java — Method Overloading. Even though it seems simple at first, understanding it deeply really shows how beautifully Java handles flexibility and readability in code. Method Overloading basically allows us to use the same method name with different parameter lists (different types, numbers, or order of parameters). It’s like teaching one method to handle different kinds of inputs — all while keeping the code clean and organized. What I find interesting is that method overloading is an example of compile-time polymorphism. This means the Java compiler decides which version of the method to call during compilation — not at runtime. It’s a small detail, but it’s what makes Java both efficient and predictable in how it executes overloaded methods. From a design point of view, method overloading really helps in writing readable, reusable, and scalable code. Instead of naming multiple methods differently for similar operations, we can keep our code intuitive and consistent. For me, revisiting these core concepts reminds me how important it is to have a strong foundation in Object-Oriented Programming. Concepts like Method Overloading might seem basic, but they build the logic behind larger frameworks and real-world applications. TAP Academy #Java #Programming #OOPs #Polymorphism #LearningJourney #SoftwareDevelopment #CodeCleanliness #TechSkills
To view or add a comment, sign in
-
-
🚀 LeetCode Problem Solving in Java 💡 Problem: Height Checker The challenge was to determine how many students are standing out of order compared to the expected (sorted) arrangement of their heights. 🧠 Approach: I copied the original array, sorted it, and compared both arrays element by element to count the mismatched positions. This helped identify how many students are not in the correct place. 📈 Concepts Used: Array manipulation Sorting Comparison and mismatch counting 🔥 Consistently solving such problems is improving my logical thinking, debugging skills, and efficiency in writing clean Java code. #LeetCode #JavaProgramming #ProblemSolving #CodingJourney #DSA #100DaysOfCode #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