💻 Exploring Java Programming: Strong Number Check 💡 Today, I practiced writing a Java program to check whether a number is a Strong Number — a number whose sum of the factorials of digits equals the number itself. For example: 👉 145 = 1! + 4! + 5! = 145 ✅ 👉 565 ≠ 5! + 6! + 5! ❌ Here’s a quick snippet from my code (shown below 👇): - Used a "while" loop for digit extraction - Calculated factorial using a nested "for" loop - Compared the final sum to the original number 🧠 Output: Enter a number to check: 145 145 is a strong number Always exciting to see how logic and math combine beautifully in programming! #Java #Coding #Programming #Learning #Engineering #StrongNumber #DeveloperJourney #CodeLogic
Shubham Padhi’s Post
More Relevant Posts
-
🚀 Java Coding Practice: Finding Maximum Continuous Sequence of Numbers Today I explored a simple yet powerful Java program that calculates the maximum continuous accuracy (or sequence) of 0s and 1s in an array. 💡 🔍 Concept Used: Looping through arrays Conditional logic Use of Math.max() to track longest continuous segments 📊 Example Output: Maximum continuous accuracy of 0 is: 3 Maximum continuous accuracy of 1 is: 4 🧠 This logic is useful in problems like binary array analysis, signal processing, or data streak detection. #Java #Programming #Coding #Learning #Developer #ProblemSolving #DataStructures #LogicBuilding
To view or add a comment, sign in
-
-
Day(11/30)| Java Problem Solving Series Today I practiced an interesting problem — Check if a number is a Palindrome At first, my logic had a small mistake I was creating a new variable inside the loop (int n = x;) which kept resetting the value of x each time. That caused the loop to never actually reverse the number properly. After debugging, I corrected it by updating x directly instead of re-declaring n. Key Learning: Always check your loop variables carefully — one small mistake (like re-initializing inside the loop) can change the entire logic! #Java #Coding #ProblemSolving #LearningEveryday #LinkedInCodingJourney #Debugging #Programming
To view or add a comment, sign in
-
-
🚀 Learning Java OOP: Class & Objects in Action Today, I explored Java Object-Oriented Programming (OOP) concepts implemented a simple program using: 1.classes 2.constructors 3.methods In this example, I created a Student class with attributes: 1.name 2.rollNo 3.marks. Using a constructor, I initialized each student's data, and a method mymethod() prints the student details. 💡 Key Takeaways: Class = blueprint for objects Object = instance of a class Constructor = initializes object data this keyword = refers to the current object Here’s a snippet of my code: [Student obj = new Student("Satish", 22, 654); obj.mymethod();] This program helped me solidify my understanding of OOP fundamentals in Java. #Java #OOP #Programming #Coding #Learning #DeveloperJourney
To view or add a comment, sign in
-
Exploring how Java handles URLs and extracts protocol, host, and file details. Small steps toward mastering network programming. 💻 #Java #Programming #LearningInPublic #DeveloperJourney #CodeNewbie #NetworkingInJava
To view or add a comment, sign in
-
-
Simple, but effective! I built a Student Grade Tracker in Java. 📊 by #CodeAlpha This project uses an ArrayList to store custom Student objects and calculates key metrics like the class average, highest grade, and lowest grade. It highlights strong foundational skills in Java and OOP. On to the next project! 📂 GitHub Repository: https://lnkd.in/eJ_94gi7 #JavaDeveloper #Coding #Programming #PortfolioProject
To view or add a comment, sign in
-
Struggling with the basics of Object-Oriented Programming (OOPs) in Java? Check out Programming Adda! They break down tough topics like classes, objects, and constructors into easy-to-understand videos. Highly recommend this resource for clear, concise learning. Link: https://lnkd.in/dXNyjApY #Coding #ProgrammingTips #JavaDeveloper
To view or add a comment, sign in
-
-
💻 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
-
-
⚙️ Java Polymorphism — One Interface, Many Forms! Polymorphism is one of the key pillars of Object-Oriented Programming (OOP) in Java. It allows objects to behave differently based on the context, enabling flexibility and reusability in code. There are two main types: 🔹 Compile-time Polymorphism → Achieved using Method Overloading and Operator Overloading 🔹 Runtime Polymorphism → Achieved using Method Overriding 💡 Polymorphism makes Java code more dynamic, easier to extend, and cleaner to maintain! #Java #OOPs #Polymorphism #Programming #Learning #Developers #Coding #Tech
To view or add a comment, sign in
-
-
🔒 Java Encapsulation — The Power of Data Hiding! Encapsulation is one of the key pillars of Object-Oriented Programming in Java. It binds data (variables) and methods (functions) together inside a single unit — the class — just like a capsule that protects its contents. ✅ Keeps data safe from direct access ✅ Provides controlled interaction using getters and setters ✅ Improves code security and maintainability 🧠 Mastering encapsulation means mastering data protection in your code! #Java #OOPs #Encapsulation #Programming #Learning #Tech #Coding #TalentBattle
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