🧡Today, I learned two important OOP (Object-Oriented Programming) concepts in Java — Method Overloading and Method Overriding. Method Overloading: When multiple methods have the same name but different parameters in the same class. void show(int a, int b); void show(String name); Method Overriding: When a child class redefines a method of its parent class with the same name and parameters. class Parent{ void display(){sout ("I'm Parent class");} } class Child extends Parent{ void display(){sout ("I'm Parent class");} } Overloading → Compile-time polymorphism Overriding → Runtime polymorphism #Java #OOPs #Programming #LearningJourney #CodeNewbie #100DaysOfCode #JavaDeveloper #LinkedInLearning
"Understanding Method Overloading and Overriding in Java"
More Relevant Posts
-
💻 Exploring Patterns in Java! Today, I implemented a simple yet classic program — a Hollow Square Pattern using nested loops in Java. This program helps in understanding: ✅ The logic behind nested for-loops ✅ The use of conditional statements for pattern control ✅ How small programs improve logical thinking & coding structure Here’s the output for input 3: *** * * *** Every line of code brings a new learning opportunity. 🔥 #Java #Programming #PatternPrinting #DeveloperJourney #CodingPractice #LogicBuilding #LearnWithCode
To view or add a comment, sign in
-
-
🚀 Exploring Java Fundamentals with a Practical Twist! Just shared a simple yet powerful Java program that identifies numbers divisible by both 3 and 5 within a user-defined range. It’s a great example of how object-oriented design and basic control structures come together to solve real-world problems. 🔍 What it does: Prompts the user for a range Iterates through numbers from 0 to that range Prints numbers divisible by both 3 and 5 💡 Whether you're just starting out or brushing up on your Java skills, this snippet is a great reminder of how clarity and logic go hand in hand in programming. #Java #Programming #ObjectOrientedDesign #CodingJourney #TechLearning #LinkedInLearning #SoftwareDevelopment
To view or add a comment, sign in
-
-
Mastering the Elements of Java Programming Language Every Java program is built on four key pillars: 🔹 Code Structure – Identifiers, classes, and methods that form the backbone of your program 🔹 Tokens – The smallest units (keywords, operators, literals) that guide the compiler 🔹 Syntax & Semantics – Rules and meaning that ensure code is both correct and logical 🔹 Comments – Notes that make code understandable for humans, not just machines Whether you’re just starting out or refining your skills, understanding these basics is the first step to writing clean, effective Java code #cubercore #Java #Programming #SoftwareDevelopment #Coding #TechLearning
To view or add a comment, sign in
-
-
🚀 Learn Java in 5 Minutes: Add Two Numbers! I just built a simple Java program that takes two numbers from the user and calculates their sum. A perfect exercise for beginners to practice variables, input, and output. Why it matters: Learn to use the Scanner class for user input ✅ Understand System.out.println() for prompts and output ✅ Build confidence before tackling bigger projects or coding challenges ✅ Sample Run: Supply a 12 Supply b 34 The sum of 12 and 34 is 46 💡 Tip: Start small. Tiny programs like this help you master the basics before moving to advanced Java concepts. You can expand it to subtraction, multiplication, or division in just a few lines. #Java #CodingForBeginners #Programming #SoftwareDevelopment #IEEEXtreme #LearnByDoing
To view or add a comment, sign in
-
-
🚀 Exploring Abstraction in Java! Today, I practiced one of the key OOP concepts — Abstraction using an example program in Java. In this program, I created an abstract class Shape and implemented different subclasses like Square, Rectangle, and Circle, each providing its own logic for calculating the area. ✨ Key Concepts Covered: Abstract classes and methods Method overriding Dynamic method dispatch Code reusability and clarity through abstraction 🧠 Output: The program accepts input for each shape and displays the calculated area dynamically. Learning abstraction helped me understand how we can hide implementation details and focus only on essential functionalities. 💻 #Java #OOPs #Abstraction #LearningByCoding #ProgrammingJourney #CodePractice
To view or add a comment, sign in
-
Day 6 of Java Programming Journey 🚀 Today, I explored one of the most important topics in Java — Strings. Here’s what I learned: 🔹 A String is a collection (sequence) of characters. 🔹 It is a predefined class in Java, introduced in version 1.0. 🔹 The String class is final, which means it cannot be extended. 🔹 Strings in Java are immutable, meaning once created, their values cannot be changed. 🔹 There are two ways to create a String: 1️⃣ Using String Literals String name = "Java"; 2️⃣ Using the new keyword String name = new String("Java"); 10000 Coders #100DaysOfCode #LeetCode #Java #CodingJourney #ProblemSolving #Developer #Programming #LearnInPublic #Coding #10000Coders
To view or add a comment, sign in
-
-
🚀 Multithreading in Java — Runnable Interface Approach After implementing multithreading using the Thread class, today I tried the second method: ✅ Implementing the Runnable interface 💡 Difference from previous approach: Instead of extending Thread We create a class that implements Runnable Then we pass that object to a Thread object and call start() In this example: ✅ One thread performs addition ✅ One prints numbers ✅ One prints characters Just like before: ✔ .run() → sequential execution ✔ .start() → runs independently and concurrently This method is more flexible because Java allows multiple interface implementations, but only single class inheritance — making Runnable a cleaner approach in real-world applications. ✅ I’ve attached the code screenshot below. ⬇️ #Java #Multithreading #Runnable #Threading #Programming #TapAcademy
To view or add a comment, sign in
-
-
Day 7 of #50DaysOfCode – Java Today I practiced arrays and conditional statements by writing a program to find the smallest number from five user inputs. 💻 What I did: Took 5 numbers from the user Stored them in an array Used a loop and if condition to find the smallest number 🧠 Concepts learned: Arrays (int[]) Loops (for) Conditional statements (if) Input/output using Scanner Step by step, getting stronger with Java! 💪 #Java #CodingJourney #LearnInPublic #Programming #50DaysOfCode
To view or add a comment, sign in
-
Day 8 of #50DaysOfCode – Java Today I practiced loops and conditional statements by writing a program to print all even numbers from 1 to 50. 💻 What I did: Used a for loop to iterate from 1 to 50 Checked each number using the modulus (%) operator Printed all even numbers 🧠 Concepts learned: Loops (for) Conditional statements (if) Modulus operator (%) Learning Java step by step! 💪 #Java #LearnInPublic #CodingJourney #Programming #50DaysOfCode
To view or add a comment, sign in
-
Day 9 of #50DaysOfCode – Java Today I practiced loops and arithmetic operations by writing a program to find the factorial of a given number. 💻 What I did: Took a number as input from the user Used a for loop to multiply numbers from 1 to n Displayed the factorial result 🧠 Concepts learned: Loops (for) Multiplication operations (*) Input/output using Scanner Step-by-step progress in Java! 💪 #Java #CodingJourney #LearnInPublic #Programming #50DaysOfCode
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