<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ebenezer</title>
    <description>The latest articles on DEV Community by Ebenezer (@buddingdeveloper).</description>
    <link>https://dev.to/buddingdeveloper</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3701631%2F77431927-bc51-45ff-a586-b2ebcb76cff5.png</url>
      <title>DEV Community: Ebenezer</title>
      <link>https://dev.to/buddingdeveloper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/buddingdeveloper"/>
    <language>en</language>
    <item>
      <title>Beginner Approach for Removing the Duplicates from Array</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Tue, 30 Jun 2026 16:51:14 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/beginner-approach-for-removing-the-duplicates-from-array-40g5</link>
      <guid>https://dev.to/buddingdeveloper/beginner-approach-for-removing-the-duplicates-from-array-40g5</guid>
      <description>&lt;p&gt;Hey folks!&lt;/p&gt;

&lt;p&gt;Good day...&lt;/p&gt;

&lt;p&gt;Today I solved and practiced one of the tasks that is given by the trailner. &lt;br&gt;
Task : To Remove the Duplicate elements in array &lt;/p&gt;

&lt;h2&gt;
  
  
  My Logic :
&lt;/h2&gt;

&lt;p&gt;As a beginner and human what we will do to solve this problem is we should take the number and compare it to another number if it is same that is duplicate . After we find the duplicted we need to remove that element .The Same logic I implemented in my code because first I have my hand in one number compare it to next number if it is same skip the change of hand to the next number . If it is not same we need to change our hand to the next number that's how we loop through the array and find the duplicate. In my code I didn't remove the duplicate and pushed the duplicates to the end of the array.After that I created a variable to store the count of the result and loop through the count of the nums and printed it. &lt;/p&gt;

&lt;p&gt;It's my kind of beginner approach (human thinking approach) there are so many methods to solve this problem like hashset , etc...&lt;/p&gt;

&lt;p&gt;As a beginner for better understanding of loops and array I did it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code :
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frbqkj2uh40jy4u0yatr2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frbqkj2uh40jy4u0yatr2.png" alt=" " width="657" height="713"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Output:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9i62nh9cz2ppzaa7fh55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9i62nh9cz2ppzaa7fh55.png" alt=" " width="661" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's all about today.&lt;/p&gt;

&lt;p&gt;Let's see tomorrow with another interesting blog...&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Understanding and Practicing the Problem - Frequency of Characters in a String</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Mon, 29 Jun 2026 14:29:16 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/understanding-and-practicing-the-problem-frequency-of-characters-in-a-string-4fo2</link>
      <guid>https://dev.to/buddingdeveloper/understanding-and-practicing-the-problem-frequency-of-characters-in-a-string-4fo2</guid>
      <description>&lt;p&gt;Hey Folks!&lt;/p&gt;

&lt;p&gt;Good Day...&lt;/p&gt;

&lt;p&gt;Today I Practiced one of the Frequently asked Question that is nothing but "To find the frequency of characters in a given string"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer : Eventhough there are so many inbuilt methods or ways to find the solution for this problem in python . As a beginner / budding developer ,  I practiced using loop for better understanding about loops and concepts.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's get into Logic first:
&lt;/h2&gt;

&lt;p&gt;By default we cannot change the string in python because Strings are Immutable in Python.So that I changed it to list , it is a basically a array in python . We can loop through it and change the characters we want.&lt;/p&gt;

&lt;p&gt;By human brain logic , let's say "ebenezer" in this string the letter "e" is appeared four times and "b" appeared one time . &lt;br&gt;
We need to run the loop and check the letter "e" is appeared or not , if it is appeared we have to increment the count.&lt;/p&gt;

&lt;p&gt;But there is one difficulties after the second letter "b" again letter "e" will come and compare with other letters. If this thing happens the output will looks like e 4 , b 1 , e 3 ...&lt;/p&gt;

&lt;p&gt;For that we have to change the already appeared letter to any unique characters like ! , @, # .&lt;/p&gt;

&lt;h2&gt;
  
  
  Code:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9942qpumzto8z1teh27w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9942qpumzto8z1teh27w.png" alt=" " width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Output:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo6n59zgdrkkyx3129trf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo6n59zgdrkkyx3129trf.png" alt=" " width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's all about this Blog . See you in my next Blog...&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>My First Linux Community Meetup</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Sun, 14 Jun 2026 08:39:46 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/my-first-linux-community-meetup-54fc</link>
      <guid>https://dev.to/buddingdeveloper/my-first-linux-community-meetup-54fc</guid>
      <description>&lt;p&gt;Hey Folks&lt;/p&gt;

&lt;p&gt;Good Day...&lt;/p&gt;

&lt;p&gt;First of all This Blog is Slightly Differnt Comparing to my Previous Blog , Coz I Wrote full of technical stuff or my learniing stuffs. &lt;br&gt;
In this Blog I wrote about my first experience in Linux Community Meetup. &lt;br&gt;
It's very Intersting Let's see How it goes from start to end&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction about ILUGC :
&lt;/h2&gt;

&lt;p&gt;In this Introduction they talked about when and where the Linux Community meetup will held and what time will start. &lt;br&gt;
And then about &lt;strong&gt;Mailing list&lt;/strong&gt; , so we need to Subscribe to mailing list , It is like a group chat . When we mail to one person all others can see it through Mailing List .&lt;br&gt;
Lastly about &lt;strong&gt;Matrix&lt;/strong&gt; , It is like Whatsapp or Telegram group chat . They requested to join in both. &lt;/p&gt;

&lt;h2&gt;
  
  
  First Talk - Google's Developer Verification Policy:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;These points are my summary or key takeaways from first talk&lt;/strong&gt;&lt;br&gt;
Google's new 2027 policy makes identity verification mandatory for all Android developers to stop fake apps. Sideloading apps from outside Google Play will  be restricted with extra safety steps for users. To install unverified apps, users must enable developer mode, restart their phone, and wait 24 hours. After the 24-hour wait, they can use Android Debug Bridge (ADB) to install the app immediately. These rules will hurt open-source projects like F-Droid because they cannot verify every developer. F-Droid says this policy could end their project since they do not control individual developer keys. Alternative app stores may disappear if Google becomes the only gatekeeper for all Android apps. This change makes Android safer but also less open for free and independent software developers.g&lt;/p&gt;

&lt;p&gt;Before the Second talk all the participants gave the Self Introduction about themselves , Profession , How they came inside the Linux World.&lt;/p&gt;

&lt;p&gt;After that the volunteer introduced a New Challenge in one website called *&lt;em&gt;W3.challs *&lt;/em&gt; .The challenge is nothing what are the differnt way to read a text in the file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Second Talk - Why Playwright Despite of Selenium:
&lt;/h2&gt;

&lt;p&gt;This talk is given by one of the audience , He is working on Automation . He used to work in Playwright tool. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;These points are my summary or key takeaways from Second talk&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Playwright has auto-waiting built-in, so tests do not fail when elements load slowly, while Selenium needs manual waits. Playwright supports parallel test execution natively, making tests run much faster on multiple browsers at once. It works with all modern browsers including Chromium, Firefox, and WebKit using a single API, while Selenium needs different drivers for each. Playwright also has built-in assertions, screenshots, videos, and API testing, so you do not need extra tools like Selenium does.&lt;/p&gt;

&lt;p&gt;for last 30 minutes the discussion , Questions and answes went on . &lt;strong&gt;From my side I asked one question which is the best developer distribution  in Linux?&lt;/strong&gt; and I got the answer for that &lt;/p&gt;

&lt;p&gt;You know any of the best developer distributor in Linux ?If you please let me know in comment section .Right now I am using mint-cinnamon If there is better distribution I can move to that for better efficieny in my work.&lt;/p&gt;

&lt;p&gt;SO, That's all about my first community meetup , I think it is Nice collaboration with working professionals ,students .&lt;/p&gt;

</description>
      <category>linux</category>
      <category>kernel</category>
      <category>webdev</category>
      <category>ai</category>
    </item>
    <item>
      <title>Prime Number Problems Explained - Easy Logic with Python Code</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Fri, 12 Jun 2026 10:25:13 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/prime-number-problems-explained-easy-logic-with-python-code-2kem</link>
      <guid>https://dev.to/buddingdeveloper/prime-number-problems-explained-easy-logic-with-python-code-2kem</guid>
      <description>&lt;p&gt;Hey guys &lt;/p&gt;

&lt;p&gt;Good day...&lt;/p&gt;

&lt;p&gt;This Blog contains the tasks which is given or Assigned by trainer. &lt;/p&gt;

&lt;p&gt;SO first problem is &lt;br&gt;
&lt;strong&gt;1) The number of prime numbers between 11 and 60 is________.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;My Logic:&lt;/strong&gt;&lt;br&gt;
Intialize the  two pointer 11 and 60 and run the while loop upto 60. Find the prime and print it .&lt;br&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo7az4zsfuv15elh6ma71.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo7az4zsfuv15elh6ma71.png" alt=" " width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmcbx3dfzz0wx7wpcuvb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmcbx3dfzz0wx7wpcuvb.png" alt=" " width="799" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Second task is &lt;br&gt;
&lt;strong&gt;2) Find the 4 Digit Prime Number - Smallest&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Logic:&lt;/strong&gt;&lt;br&gt;
Run the loop between 1000 to 9999 so we all know first prime number is the smallest that's why I breaked the loop&lt;br&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9unn6670oby0uxh5zqoi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9unn6670oby0uxh5zqoi.png" alt=" " width="742" height="268"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqm6v6lpduu4hxj57zei.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqm6v6lpduu4hxj57zei.png" alt=" " width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Third task is &lt;br&gt;
&lt;strong&gt;3) Write the smallest and the biggest two digit prime number. [First, Last --&amp;gt; Greatest Common Divisor]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Logic:&lt;/strong&gt;&lt;br&gt;
Initialize the first and last variable with 0 and run the while loop between 10 to 99 if the prime loop runs firstly copy the value of the number to first and when the loop ends copy the last number to Last&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ie3nvjqt0gvujfcxkji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ie3nvjqt0gvujfcxkji.png" alt=" " width="781" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdx3coo8xjjh4gbk5yxew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdx3coo8xjjh4gbk5yxew.png" alt=" " width="800" height="72"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fouth task is&lt;br&gt;
&lt;strong&gt;4)I am a two digit prime number and the sum of my digits is 10. I am also one of the factors of 57. Who am I?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Logic:&lt;/strong&gt;&lt;br&gt;
They told only two digit so we are going to run a loop upto 99 and I created a function to find the sum of digits and when the prime number true loop starts run we are calling the function with prime number to find the sum of digits and nested if condition is check the factor for 57.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fso6q0o76ndd54sgyfm00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fso6q0o76ndd54sgyfm00.png" alt=" " width="700" height="480"&gt;&lt;/a&gt;:&lt;br&gt;
&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhmjwdsatd8cdh3esxeb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhmjwdsatd8cdh3esxeb.png" alt=" " width="794" height="50"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fifth task is &lt;br&gt;
&lt;strong&gt;5)What is the smallest 5 digit number that is exactly divisible by 72 and 108?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Logic:&lt;/strong&gt;&lt;br&gt;
As they given the smallest five digit run the loop from 10000 to 99999 and the checking the condition using if and break the loop because they asked to find first only &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mh1xjsenfyg9e19h8w6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mh1xjsenfyg9e19h8w6.png" alt=" " width="777" height="162"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05m3bm6gaic9lt6sbd84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05m3bm6gaic9lt6sbd84.png" alt=" " width="800" height="51"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last task is&lt;br&gt;&lt;br&gt;
&lt;strong&gt;6) There are four Mobile Phones in a house. At 5 a.m, all the four Mobile&lt;br&gt;
Phones will ring together. Thereafter, the first one rings every 15 minutes, the second one&lt;br&gt;
rings every 20 minutes, the third one rings every 25 minutes and the fourth one rings&lt;br&gt;
every 30 minutes. At what time, will the four Mobile Phones ring together again?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Logic:&lt;/strong&gt; This task is little bit tricky compared to all and also writing code . so we have to Least common multiple for 15,20,25,30 . Least common multiple is nothing but the joining point of all number . If we find that the task is over &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm88fpnb1jgtmntra35w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm88fpnb1jgtmntra35w.png" alt=" " width="800" height="352"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q3tl5qlatqgs29wbnlf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q3tl5qlatqgs29wbnlf.png" alt=" " width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After 5'o clock the alarm will ring at 10'o clock.&lt;/p&gt;

&lt;p&gt;That's all about today's task&lt;br&gt;
Let's see in another blog with different tasks...&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>programming</category>
      <category>ai</category>
    </item>
    <item>
      <title>Twin Primes and Divisible by 11</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Thu, 11 Jun 2026 20:51:59 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/twin-primes-and-divisible-by-11-5hjg</link>
      <guid>https://dev.to/buddingdeveloper/twin-primes-and-divisible-by-11-5hjg</guid>
      <description>&lt;p&gt;Hey guys&lt;/p&gt;

&lt;p&gt;Good day...&lt;/p&gt;

&lt;p&gt;Continuation to the previous blog . Today I solved two tasks which is assigned by our trainer. These programs taught me how to use functions and where to use functions and another one is to thoroughly understand the modulo and float logic . &lt;/p&gt;

&lt;p&gt;Ok first things first&lt;/p&gt;

&lt;h2&gt;
  
  
  1 .Twin Prime
&lt;/h2&gt;

&lt;p&gt;Firstly the logic is simple we need to check the number is prime if the number is prime add it with 2 after adding pass the numbe to function to check that is also prime. That's how I thinks logic eventhough I'm weak in syntax stuff I did the program with trial and errror method&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4q29je90y0pq3r751gfp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4q29je90y0pq3r751gfp.png" alt=" " width="756" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Output : &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7x07dfitru3y2sq7xfiq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7x07dfitru3y2sq7xfiq.png" alt=" " width="798" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2.Divisible by 11
&lt;/h2&gt;

&lt;p&gt;This problem we need to filter the number because the divisibility rule for 11 is  Sum of alternative digits is either  by 11 or Zero&lt;/p&gt;

&lt;p&gt;So for example the number is &lt;strong&gt;675433&lt;/strong&gt; so after the sum of alternative digits the answer is 14 and 14 and If we subtract it result will be zero &lt;br&gt;
Another example is **272822 **so after the sum of alternative digits the answer is 17 and 6 If we subtract that the result is 11 &lt;/p&gt;

&lt;p&gt;Code :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2onn3fu4gbt6foyp963.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2onn3fu4gbt6foyp963.png" alt=" " width="690" height="296"&gt;&lt;/a&gt;&lt;br&gt;
Output : &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Friz2x9awxr7du5sdpthf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Friz2x9awxr7du5sdpthf.png" alt=" " width="800" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So that's all about today's blog , Please adjust my English coz I'm very weak in grammar . I will learn and improve .&lt;/p&gt;

&lt;p&gt;Let's see in next blog - Different tasks and Different Blog...&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Problems can be Solved using Modulo and Float Operators</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Thu, 11 Jun 2026 14:24:06 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/problems-can-be-solved-using-modulo-and-float-operators-2f2m</link>
      <guid>https://dev.to/buddingdeveloper/problems-can-be-solved-using-modulo-and-float-operators-2f2m</guid>
      <description>&lt;p&gt;Hey guys&lt;/p&gt;

&lt;p&gt;Good day...&lt;/p&gt;

&lt;p&gt;Yesterday Trainer assigned some tasks in python like divisibility check and printing some number patterns.&lt;br&gt;
We will detaily in the blog how I solved using Modulo and Float Operators.&lt;/p&gt;

&lt;p&gt;Firstly, The problem is we need to print &lt;strong&gt;34 23 12&lt;/strong&gt; using the given number &lt;strong&gt;1234&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffijre2rwt0zrddxxpfyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffijre2rwt0zrddxxpfyp.png" alt=" " width="767" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output which I got is &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fym6jwxkz73xagty884wh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fym6jwxkz73xagty884wh.png" alt=" " width="800" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here I binded another problem which is assigned by trainer to find the total of the printed digits that is** 34 23 12**&lt;/p&gt;

&lt;p&gt;Second task is similiar to first one but there is small change in operations . so we need to print to** 34 12** using the given number &lt;strong&gt;1234&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;for that &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgof4c29ojmjlhgs4osml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgof4c29ojmjlhgs4osml.png" alt=" " width="800" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output which I got is &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbx2d1756txmlqr6quru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbx2d1756txmlqr6quru.png" alt=" " width="800" height="47"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Third task is little bit different we need to print &lt;strong&gt;456 123&lt;/strong&gt; using the given number &lt;strong&gt;123456&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;for that&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsumeqlmzy7ru6blun2v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsumeqlmzy7ru6blun2v.png" alt=" " width="783" height="113"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output which I got is &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7y7fw2t1yvnt361pauqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7y7fw2t1yvnt361pauqt.png" alt=" " width="800" height="57"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for Seeing and Reading my Blog , Next Blog we will see about Twin Primes ,Consecutive Primes , Divisible by 11 &lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Understanding Encapsulation in Java:Access Modifiers , Getters and Setters for Beginners</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Wed, 10 Jun 2026 22:01:22 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/understanding-encapsulation-in-javaaccess-modifiers-getters-and-setters-for-beginners-1841</link>
      <guid>https://dev.to/buddingdeveloper/understanding-encapsulation-in-javaaccess-modifiers-getters-and-setters-for-beginners-1841</guid>
      <description>&lt;p&gt;Hey guys&lt;/p&gt;

&lt;p&gt;Good day!&lt;/p&gt;

&lt;p&gt;Today I learned one of the four pillars of OOP concepts that's wrapped inside the blog.&lt;br&gt;
As I said, wrapped—guess what? It's nothing but encapsulation.&lt;br&gt;
In encapsulation, as of now, I learned access modifiers and getter-setter methods. We will see them in detail in the blog.&lt;/p&gt;
&lt;h2&gt;
  
  
  Access Modifiers:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Definition :&lt;/strong&gt; Access level modifiers determine whether other classes can use a particular field or invoke a particular method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are two levels of access control:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At the top level—public, or package-private (no explicit modifier).&lt;/li&gt;
&lt;li&gt;  At the member level—public, private, protected, or package-private (no explicit modifier).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Types of Access Modifiers:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Public&lt;/li&gt;
&lt;li&gt;Default or package- private&lt;/li&gt;
&lt;li&gt;Private&lt;/li&gt;
&lt;li&gt;Protected&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Public :
&lt;/h2&gt;

&lt;p&gt;As the name gives it can be accessed by all&lt;br&gt;
All means same class , same package child class, different package child class, same package non-child class ,different package non-child class. &lt;/p&gt;
&lt;h2&gt;
  
  
  Default or Package-Private :
&lt;/h2&gt;

&lt;p&gt;As the name suggests it can be accessed only within the same package &lt;/p&gt;
&lt;h2&gt;
  
  
  Private :
&lt;/h2&gt;

&lt;p&gt;As the name suggests ,  it is private to the parent classs, it  cannot be accessed by no one outside the class.&lt;/p&gt;
&lt;h2&gt;
  
  
  Protected :
&lt;/h2&gt;

&lt;p&gt;It is bit tricky when I practiced it. It can accessed by any class within the same package and  by sub classes in the different packages.&lt;/p&gt;
&lt;h2&gt;
  
  
  Differentiation summary :
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4aqur0ajuwoo5n878y81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4aqur0ajuwoo5n878y81.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Getter and Setter methods :
&lt;/h2&gt;

&lt;p&gt;Why we need that method : &lt;/p&gt;

&lt;p&gt;Class 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GRT&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;


&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;14200&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;


&lt;span class="c1"&gt;//getter method&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;getPrice&lt;/span&gt;&lt;span class="o"&gt;(){;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;setPrice&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Amount is less then fixed value"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;




&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Class 2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
                &lt;span class="no"&gt;GRT&lt;/span&gt; &lt;span class="n"&gt;grt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;GRT&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;//                 int itemPrice = grt.getPrice();&lt;/span&gt;
&lt;span class="c1"&gt;//                System.out.println(itemPrice);&lt;/span&gt;

                    &lt;span class="n"&gt;grt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setPrice&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;14500&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;grt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getPrice&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
                    &lt;span class="n"&gt;grt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setPrice&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;14000&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Story for the above code :&lt;/strong&gt;&lt;br&gt;
 There is a jewellery shop called GRT. Every day, the gold rate goes up and down. A customer visits the jewellery shop. Note that if the jewellery shop keeps the gold price public, the customer can access and change the price to whatever he or she wants. That is why we keep the price private.&lt;/p&gt;

&lt;p&gt;When the customer walks into the shop and asks for the current gold price, that is called the getter method. If the customer wants to change the price, there is only one way to do it: through the setter method.&lt;/p&gt;

&lt;p&gt;Inside the setter method, we can apply any conditions, rules, and regulations because the shop belongs to us.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can we connect it with Encapsulation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The gold price is kept private, so it cannot be accessed directly from outside the class.&lt;/p&gt;

&lt;p&gt;The getter method is used to read or view the gold price.&lt;/p&gt;

&lt;p&gt;The setter method is used to update the gold price while enforcing business rules and validations.&lt;/p&gt;

&lt;p&gt;This is how encapsulation protects data and provides controlled access to it.&lt;/p&gt;

&lt;p&gt;If you any doubts or clarifications feel free ask in the comment section because I am budding developer . Goodfeedbacks are always taken. &lt;/p&gt;

&lt;p&gt;Let's see in the another Interesting Blog...&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Palindrome Number — My Beginner Thinking Process, Pseudocode &amp; Optimal Solution</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Sun, 07 Jun 2026 14:33:11 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/palindrome-number-my-beginner-thinking-process-pseudocode-optimal-solution-32jb</link>
      <guid>https://dev.to/buddingdeveloper/palindrome-number-my-beginner-thinking-process-pseudocode-optimal-solution-32jb</guid>
      <description>&lt;p&gt;Hey Folks! 👋&lt;/p&gt;

&lt;p&gt;Good Day...&lt;/p&gt;

&lt;p&gt;As I shared in my previous blog, I have started a new problem-solving practice routine. From today onwards, I'll be working on some of the most commonly asked interview questions that developers often encounter during coding interviews. These problems are also popular on LeetCode, making them a great way to strengthen both problem-solving skills and coding fundamentals.&lt;br&gt;
Today I solved one of the most famous beginner-friendly LeetCode problems: &lt;strong&gt;Palindrome Number&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At first, I wasn't thinking about code. I was thinking about the pattern.&lt;/p&gt;
&lt;h2&gt;
  
  
  Problem Statement
&lt;/h2&gt;

&lt;p&gt;Given an integer &lt;code&gt;x&lt;/code&gt;, return &lt;code&gt;true&lt;/code&gt; if &lt;code&gt;x&lt;/code&gt; is a palindrome and &lt;code&gt;false&lt;/code&gt; otherwise.&lt;/p&gt;
&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;121  -&amp;gt; true

-121 -&amp;gt; false

10   -&amp;gt; false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;A palindrome reads the same from left to right and right to left.&lt;/p&gt;


&lt;h1&gt;
  
  
  My Initial Thinking (Two Pointer Approach)
&lt;/h1&gt;

&lt;p&gt;Before writing any code, I drew the number on paper.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 2 1 2 1
↑       ↑
L       R
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I started comparing the first and last digits.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 == 1 

2 == 2 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eventually both pointers meet in the middle.&lt;/p&gt;

&lt;p&gt;Since every comparison matched, the number is a palindrome.&lt;/p&gt;

&lt;p&gt;My thought process was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compare left digit with right digit.

If both are same:
    Move inward.

If different:
    Not a palindrome.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is exactly how humans check a palindrome.&lt;/p&gt;




&lt;h1&gt;
  
  
  Rule #1: Negative Numbers Are Never Palindromes
&lt;/h1&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-121
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read from left to right:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-121
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read from right to left:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;121-
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both are different.&lt;/p&gt;

&lt;p&gt;Therefore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Any negative number is NOT a palindrome.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Rule #2: Numbers Ending With 0 Are Not Palindromes
&lt;/h1&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reverse:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not the same.&lt;/p&gt;

&lt;p&gt;Therefore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;If a number ends with 0 and is not 0 itself,
it cannot be a palindrome.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10   
100  
120  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is a palindrome.&lt;/p&gt;




&lt;h1&gt;
  
  
  Moving From Pointer Thinking to Math Thinking
&lt;/h1&gt;

&lt;p&gt;My initial idea was based on pointers.&lt;/p&gt;

&lt;p&gt;However, LeetCode asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can you solve it without converting the integer into a string?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That means we cannot use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;valueOf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead, we need to work directly with digits.&lt;/p&gt;

&lt;p&gt;We can extract digits using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and remove digits using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Beginner-Friendly Pseudocode
&lt;/h1&gt;

&lt;p&gt;This is the pseudocode I understood before writing Java.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;If number is negative
    Return false

If number ends with 0 and is not 0
    Return false

Create reversedHalf = 0

While original number is greater than reversedHalf

    Take the last digit

    Add that digit into reversedHalf

    Remove last digit from original number

For even length numbers:
    Compare original number and reversedHalf

For odd length numbers:
    Compare original number and reversedHalf/10

Return result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Understanding rev / 10
&lt;/h1&gt;

&lt;p&gt;This confused me initially.&lt;/p&gt;

&lt;p&gt;Let's take:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;121
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After processing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x   = 1
rev = 12
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rev
↓
1 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The middle digit got included.&lt;/p&gt;

&lt;p&gt;The middle digit doesn't need comparison because it has no pair.&lt;/p&gt;

&lt;p&gt;So we remove it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;12 / 10 = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 1
rev/10 = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Match found &lt;/p&gt;

&lt;p&gt;That's why the final condition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Optimal Java Solution
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Solution&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;isPalindrome&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;

        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;digit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;digit&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Output
&lt;/h1&gt;

&lt;p&gt;For input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;121
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I verified the solution on LeetCode and it was accepted successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Freay4punck4cj1jhoc08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Freay4punck4cj1jhoc08.png" alt=" " width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Time Complexity
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;O(log₁₀ n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We process only half of the digits.&lt;/p&gt;




&lt;h1&gt;
  
  
  Space Complexity
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;O(1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No extra array, string, or collection is used.&lt;/p&gt;




&lt;p&gt;Thanks for reading! &lt;/p&gt;

&lt;p&gt;If you're also learning Data Structures &amp;amp; Algorithms as a beginner, feel free to share how you initially thought about this problem. Sometimes your thinking teaches more than an advanced solution.&lt;/p&gt;

</description>
      <category>probelemsolving</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Java for Beginners: Why Learn Java Instead of C, C++, C#, Python, or JavaScript?</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Sat, 06 Jun 2026 16:19:18 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/java-for-beginners-why-learn-java-instead-of-c-c-c-python-or-javascript-30fm</link>
      <guid>https://dev.to/buddingdeveloper/java-for-beginners-why-learn-java-instead-of-c-c-c-python-or-javascript-30fm</guid>
      <description>&lt;p&gt;Hey Folks! 👋&lt;/p&gt;

&lt;p&gt;Good Day...&lt;/p&gt;

&lt;p&gt;I started learning Java one week ago.&lt;/p&gt;

&lt;p&gt;Every day I hear the word &lt;strong&gt;Java&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If somebody asks me, "What are you studying in your crash course?"&lt;/p&gt;

&lt;p&gt;My answer is always:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Java."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In class, Java.&lt;/p&gt;

&lt;p&gt;During practice, Java.&lt;/p&gt;

&lt;p&gt;In Institute, Java.&lt;/p&gt;

&lt;p&gt;Almost every day, the word Java appears somewhere in my life.&lt;/p&gt;

&lt;p&gt;One day I was sitting quietly and started overthinking.&lt;/p&gt;

&lt;p&gt;Questions began running through my mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why Java?&lt;/li&gt;
&lt;li&gt;What is Java?&lt;/li&gt;
&lt;li&gt;When should we use Java?&lt;/li&gt;
&lt;li&gt;How is Java different from other programming languages?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I believe asking the right questions is called &lt;strong&gt;curiosity&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And curiosity is often the starting point of mastering any skill.&lt;/p&gt;

&lt;p&gt;Instead of ignoring these questions, I started researching. I spent time reading Oracle documentation, developer forums, Reddit discussions, Medium articles, and programming communities.&lt;/p&gt;

&lt;p&gt;This blog is a summary of everything I learned in the simplest way possible.&lt;/p&gt;

&lt;p&gt;Let's begin.&lt;/p&gt;




&lt;h1&gt;
  
  
  Before Java, Let's Understand the Problem
&lt;/h1&gt;

&lt;p&gt;Today we have many programming languages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C&lt;/li&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;li&gt;C#&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;li&gt;Kotlin&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the obvious question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do colleges, institutes, and companies still teach Java?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The answer is simple:&lt;/p&gt;

&lt;p&gt;Java solves some very important software engineering problems extremely well.&lt;/p&gt;

&lt;p&gt;It is not the "best" language for everything.&lt;/p&gt;

&lt;p&gt;But it is one of the most balanced languages ever created.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Makes Java Different?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Write Once, Run Anywhere (WORA)
&lt;/h2&gt;

&lt;p&gt;This is probably Java's most famous feature.&lt;/p&gt;

&lt;p&gt;Suppose you write a Java program on Windows.&lt;/p&gt;

&lt;p&gt;You can run the same program on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;li&gt;macOS&lt;/li&gt;
&lt;li&gt;Unix&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;without changing the source code.&lt;/p&gt;

&lt;p&gt;This concept is called:&lt;/p&gt;

&lt;h3&gt;
  
  
  Write Once, Run Anywhere
&lt;/h3&gt;

&lt;p&gt;How?&lt;/p&gt;

&lt;p&gt;Because Java code is converted into something called &lt;strong&gt;Bytecode&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That Bytecode runs inside the &lt;strong&gt;JVM (Java Virtual Machine)&lt;/strong&gt;. Oracle explains that Java programs are compiled into platform-independent bytecode which is executed by a JVM available for different operating systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real-Life Example
&lt;/h3&gt;

&lt;p&gt;Imagine writing a movie in English.&lt;/p&gt;

&lt;p&gt;Instead of rewriting the movie in Tamil, Hindi, Telugu, and Malayalam, you simply use a translator.&lt;/p&gt;

&lt;p&gt;The JVM acts like that translator.&lt;/p&gt;

&lt;p&gt;Your Java code stays the same.&lt;/p&gt;

&lt;p&gt;Only the JVM changes depending on the operating system.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Easier Than C and C++
&lt;/h1&gt;

&lt;p&gt;Many experienced developers say Java borrowed the good parts of C and C++ while removing some complicated features.&lt;/p&gt;

&lt;p&gt;Java removes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Direct memory manipulation&lt;/li&gt;
&lt;li&gt;Complex pointer handling&lt;/li&gt;
&lt;li&gt;Multiple inheritance through classes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes learning easier for beginners. Oracle's documentation notes that Java's syntax is similar to C and C++ but omits features that make those languages complex and unsafe.&lt;/p&gt;

&lt;h3&gt;
  
  
  Beginner View
&lt;/h3&gt;

&lt;p&gt;Think about driving.&lt;/p&gt;

&lt;p&gt;C and C++ are like driving a manual sports car.&lt;/p&gt;

&lt;p&gt;Java is like driving a modern automatic car.&lt;/p&gt;

&lt;p&gt;You still learn driving principles, but with fewer chances to make dangerous mistakes.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Automatic Memory Management
&lt;/h1&gt;

&lt;p&gt;One of the biggest problems in programming is memory management.&lt;/p&gt;

&lt;p&gt;In languages like C, developers often need to manually manage memory.&lt;/p&gt;

&lt;p&gt;Java introduced something called:&lt;/p&gt;

&lt;h3&gt;
  
  
  Garbage Collection
&lt;/h3&gt;

&lt;p&gt;The JVM automatically removes unused objects from memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real-Life Example
&lt;/h3&gt;

&lt;p&gt;Imagine your room.&lt;/p&gt;

&lt;p&gt;Instead of cleaning old waste yourself every day, someone automatically removes garbage whenever it becomes useless.&lt;/p&gt;

&lt;p&gt;That's exactly what Java's Garbage Collector does.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Strong Object-Oriented Programming (OOP)
&lt;/h1&gt;

&lt;p&gt;When people say:&lt;/p&gt;

&lt;p&gt;"Learn Java and your programming fundamentals become strong."&lt;/p&gt;

&lt;p&gt;They are usually talking about OOP.&lt;/p&gt;

&lt;p&gt;Java heavily encourages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classes&lt;/li&gt;
&lt;li&gt;Objects&lt;/li&gt;
&lt;li&gt;Encapsulation&lt;/li&gt;
&lt;li&gt;Inheritance&lt;/li&gt;
&lt;li&gt;Polymorphism&lt;/li&gt;
&lt;li&gt;Abstraction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These concepts are used in enterprise software around the world.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Is This Important?
&lt;/h3&gt;

&lt;p&gt;Large companies build huge applications.&lt;/p&gt;

&lt;p&gt;Without proper structure, the code becomes a nightmare.&lt;/p&gt;

&lt;p&gt;Java helps organize software like a well-planned city.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Enterprise Companies Love Java
&lt;/h1&gt;

&lt;p&gt;Many large organizations use Java because it is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stable&lt;/li&gt;
&lt;li&gt;Secure&lt;/li&gt;
&lt;li&gt;Scalable&lt;/li&gt;
&lt;li&gt;Reliable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Oracle states that Java remains one of the world's most widely used development platforms and continues to be a preferred choice for enterprises.&lt;/p&gt;

&lt;p&gt;Industries using Java include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Banking&lt;/li&gt;
&lt;li&gt;Insurance&lt;/li&gt;
&lt;li&gt;Healthcare&lt;/li&gt;
&lt;li&gt;Manufacturing&lt;/li&gt;
&lt;li&gt;E-commerce&lt;/li&gt;
&lt;li&gt;Government systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is one reason Java skills remain valuable.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Multithreading Support
&lt;/h1&gt;

&lt;p&gt;Java allows multiple tasks to run simultaneously.&lt;/p&gt;

&lt;p&gt;This feature is called:&lt;/p&gt;

&lt;h3&gt;
  
  
  Multithreading
&lt;/h3&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;While downloading a file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One thread downloads data.&lt;/li&gt;
&lt;li&gt;Another thread updates the progress bar.&lt;/li&gt;
&lt;li&gt;Another thread keeps the application responsive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Java provides built-in support for this capability.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Security
&lt;/h1&gt;

&lt;p&gt;Security was one of Java's design goals from the beginning.&lt;/p&gt;

&lt;p&gt;Java programs run inside the JVM, which adds an extra layer of protection.&lt;/p&gt;

&lt;p&gt;This is one reason Java became popular in enterprise environments. Oracle documentation highlights Java's security-focused architecture and runtime environment.&lt;/p&gt;




&lt;h1&gt;
  
  
  Java vs Other Popular Languages
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Java vs C
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Java&lt;/th&gt;
&lt;th&gt;C&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Object-Oriented&lt;/td&gt;
&lt;td&gt;Procedural&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automatic Memory Management&lt;/td&gt;
&lt;td&gt;Manual Memory Management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Platform Independent&lt;/td&gt;
&lt;td&gt;Platform Dependent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Easier for Large Applications&lt;/td&gt;
&lt;td&gt;Great for System Programming&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Java vs C++
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Java&lt;/th&gt;
&lt;th&gt;C++&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Simpler&lt;/td&gt;
&lt;td&gt;More Complex&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Garbage Collection&lt;/td&gt;
&lt;td&gt;Manual Memory Handling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safer for Beginners&lt;/td&gt;
&lt;td&gt;More Control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JVM Based&lt;/td&gt;
&lt;td&gt;Native Compilation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Java vs Python
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Java&lt;/th&gt;
&lt;th&gt;Python&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Faster in Many Enterprise Cases&lt;/td&gt;
&lt;td&gt;Simpler Syntax&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Strong OOP Structure&lt;/td&gt;
&lt;td&gt;Very Beginner Friendly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Used Heavily in Large Enterprises&lt;/td&gt;
&lt;td&gt;Popular in AI and Data Science&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Java vs JavaScript
&lt;/h2&gt;

&lt;p&gt;Many beginners think Java and JavaScript are related.&lt;/p&gt;

&lt;p&gt;They are completely different languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Java
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Backend&lt;/li&gt;
&lt;li&gt;Android&lt;/li&gt;
&lt;li&gt;Enterprise Software&lt;/li&gt;
&lt;li&gt;Banking Applications&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  JavaScript
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Websites&lt;/li&gt;
&lt;li&gt;Frontend Development&lt;/li&gt;
&lt;li&gt;Browser Applications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The names are similar.&lt;/p&gt;

&lt;p&gt;The languages are not.&lt;/p&gt;




&lt;h1&gt;
  
  
  So Why Do Institutes Teach Java First?
&lt;/h1&gt;

&lt;p&gt;Because Java sits in the middle.&lt;/p&gt;

&lt;p&gt;It teaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Programming logic&lt;/li&gt;
&lt;li&gt;OOP concepts&lt;/li&gt;
&lt;li&gt;Software architecture&lt;/li&gt;
&lt;li&gt;Industry coding practices&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you understand Java well:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python becomes easier&lt;/li&gt;
&lt;li&gt;C# becomes easier&lt;/li&gt;
&lt;li&gt;JavaScript becomes easier&lt;/li&gt;
&lt;li&gt;Frameworks become easier&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Java teaches the foundation.&lt;/p&gt;




&lt;h1&gt;
  
  
  My  Learnings :
&lt;/h1&gt;

&lt;p&gt;Initially I thought:&lt;/p&gt;

&lt;p&gt;"Java is just another programming language."&lt;/p&gt;

&lt;p&gt;After researching, I realized:&lt;/p&gt;

&lt;p&gt;Java is not famous simply because it is old.&lt;/p&gt;

&lt;p&gt;Java is famous because it solves real-world software problems very effectively.&lt;/p&gt;

&lt;p&gt;The more I learn Java, the more I understand that it is teaching me not only syntax but also how professional software is designed.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;If you are a beginner and wondering:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Should I learn Java in 2026?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My answer would be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not because Java is perfect.&lt;/p&gt;

&lt;p&gt;Not because Java is the easiest.&lt;/p&gt;

&lt;p&gt;But because Java teaches programming fundamentals, software design, object-oriented thinking, and industry-standard development practices.&lt;/p&gt;

&lt;p&gt;And those skills remain valuable regardless of which programming language you learn next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep asking questions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because curiosity is where every developer's journey begins. &lt;/p&gt;




&lt;h1&gt;
  
  
  Sources
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.oracle.com/java/" rel="noopener noreferrer"&gt;https://www.oracle.com/java/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/jjdev/Java-overview.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/en/database/oracle/oracle-database/26/jjdev/Java-overview.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-1.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-1.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/java/java-features/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/java/java-features/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/java/java/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/java/java/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.java/" rel="noopener noreferrer"&gt;https://dev.java/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@sadigrzazada20/understanding-the-java-platform-jvm-jre-and-jdk-explained-74be8253e8df" rel="noopener noreferrer"&gt;https://medium.com/@sadigrzazada20/understanding-the-java-platform-jvm-jre-and-jdk-explained-74be8253e8df&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@ucgorai/java-8-features-that-every-programmer-must-know-39e73a1daafb" rel="noopener noreferrer"&gt;https://medium.com/@ucgorai/java-8-features-that-every-programmer-must-know-39e73a1daafb&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.reddit.com/r/java/" rel="noopener noreferrer"&gt;https://www.reddit.com/r/java/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.quora.com/Why-is-Java-still-so-popular" rel="noopener noreferrer"&gt;https://www.quora.com/Why-is-Java-still-so-popular&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>java</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Python Looping #3: Divisors, Multiples, and Number Patterns Explained</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Sat, 06 Jun 2026 05:16:52 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/python-looping-3-divisors-multiples-and-number-patterns-explained-41mi</link>
      <guid>https://dev.to/buddingdeveloper/python-looping-3-divisors-multiples-and-number-patterns-explained-41mi</guid>
      <description>&lt;p&gt;Hey Folks! 👋&lt;/p&gt;

&lt;p&gt;Good Day.&lt;/p&gt;

&lt;p&gt;Welcome back to Day 3 of my Python Problem Solving journey.&lt;/p&gt;

&lt;p&gt;Over the past few days, our trainer assigned us 15 beginner-level Python problems to strengthen our logical thinking and programming fundamentals.&lt;/p&gt;

&lt;p&gt;In my previous blogs, I covered factorials, perfect numbers, and custom number patterns. Today, I completed the remaining problems from the assignment using simple logic and basic Python concepts.&lt;/p&gt;

&lt;p&gt;Whenever I face a new problem, I try to answer three questions before writing code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the expected output?&lt;/li&gt;
&lt;li&gt;What pattern do I see?&lt;/li&gt;
&lt;li&gt;How would I solve it manually on paper?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once those answers become clear, the code usually becomes straightforward.&lt;/p&gt;

&lt;p&gt;In this Blog, I'll share the solutions along with the way I approached each problem mentally.&lt;/p&gt;




&lt;h1&gt;
  
  
  Problem 1: Finding Divisors of a Number
&lt;/h1&gt;

&lt;p&gt;Let's take the number 10.&lt;/p&gt;

&lt;p&gt;The divisors of 10 are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 2 5 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A divisor is simply a number that divides another number without leaving a remainder.&lt;/p&gt;

&lt;p&gt;Before coding, I thought:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If I wanted to find all divisors manually, I would check every number from 1 to 10 and see whether it divides 10 perfectly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That thought became the algorithm.&lt;/p&gt;

&lt;h2&gt;
  
  
  Python Solution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pseudocode
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;START

number = 10

FOR every value from 1 to number

    IF number is divisible by current value

        PRINT current value

END FOR

PRINT total divisor count

STOP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;p&gt;The modulus operator (&lt;code&gt;%&lt;/code&gt;) is one of the most useful tools in problem solving.&lt;/p&gt;

&lt;p&gt;Whenever I need to check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;divisors&lt;/li&gt;
&lt;li&gt;multiples&lt;/li&gt;
&lt;li&gt;odd numbers&lt;/li&gt;
&lt;li&gt;even numbers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I almost always end up using &lt;code&gt;%&lt;/code&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Problem 2: Multiples of 3 and 5
&lt;/h1&gt;

&lt;p&gt;The goal was to print numbers that are divisible by both 3 and 5 between 1 and 100.&lt;/p&gt;

&lt;p&gt;Before coding, I asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What makes a number a multiple of both 3 and 5?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Answer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;number % 3 == 0
AND
number % 5 == 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Python Solution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pseudocode
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;START

number = 1

WHILE number &amp;lt;= 100

    IF divisible by 3 AND divisible by 5

        PRINT number

    number = number + 1

END WHILE

STOP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Learning
&lt;/h3&gt;

&lt;p&gt;Many beginners confuse:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="ow"&gt;and&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="ow"&gt;or&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;and&lt;/code&gt; → both conditions must be true&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;or&lt;/code&gt; → at least one condition must be true&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Problem 3: Simple Number Patterns
&lt;/h1&gt;

&lt;p&gt;Most beginners see pattern problems as difficult.&lt;/p&gt;

&lt;p&gt;I used to think the same.&lt;/p&gt;

&lt;p&gt;Now I try a different approach.&lt;/p&gt;

&lt;p&gt;Instead of looking at the whole pattern, I ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What changes between one number and the next?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once I find that relationship, the pattern becomes easy.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pattern 1
&lt;/h2&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 1 1 1 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Observation
&lt;/h3&gt;

&lt;p&gt;Nothing changes.&lt;/p&gt;

&lt;p&gt;The same value is printed every time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pattern 2
&lt;/h2&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 2 3 4 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Observation
&lt;/h3&gt;

&lt;p&gt;Increase by 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pattern 3
&lt;/h2&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 3 5 7 9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Observation
&lt;/h3&gt;

&lt;p&gt;Increase by 2.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pattern 4
&lt;/h2&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3 6 9 12 15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Observation
&lt;/h3&gt;

&lt;p&gt;Multiples of 3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pattern 5
&lt;/h2&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;15 12 9 6 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Observation
&lt;/h3&gt;

&lt;p&gt;Reverse multiples of 3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pattern 6
&lt;/h2&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10 8 6 4 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Observation
&lt;/h3&gt;

&lt;p&gt;Reverse multiples of 2.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pattern 7
&lt;/h2&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;9 7 5 3 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Observation
&lt;/h3&gt;

&lt;p&gt;Reverse odd numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  The Biggest Lesson From These 15 Problems
&lt;/h1&gt;

&lt;p&gt;After solving all 15 problems, I realized something interesting.&lt;/p&gt;

&lt;p&gt;The challenge was never Python.&lt;/p&gt;

&lt;p&gt;The challenge was understanding the pattern.&lt;/p&gt;

&lt;p&gt;Once the logic became clear, the code became simple.&lt;/p&gt;




&lt;h1&gt;
  
  
  What's Next?
&lt;/h1&gt;

&lt;p&gt;With these beginner practice problems completed, I'll be moving to a new phase from tomorrow.&lt;/p&gt;

&lt;p&gt;Instead of simple exercises, I'll start solving interview-style and job-market coding questions in detail.&lt;/p&gt;

&lt;p&gt;The focus will be on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Problem-solving approaches&lt;/li&gt;
&lt;li&gt;Multiple solutions&lt;/li&gt;
&lt;li&gt;Time complexity discussions&lt;/li&gt;
&lt;li&gt;Common interview questions&lt;/li&gt;
&lt;li&gt;Real-world coding challenges&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's see what tomorrow brings.&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Java Runtime Polymorphism Explained: My Learning Journey with Method Overriding</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Fri, 05 Jun 2026 16:29:32 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/java-runtime-polymorphism-explained-my-learning-journey-with-method-overriding-5bjd</link>
      <guid>https://dev.to/buddingdeveloper/java-runtime-polymorphism-explained-my-learning-journey-with-method-overriding-5bjd</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hey Folks! 👋&lt;/p&gt;

&lt;p&gt;Good Day...&lt;/p&gt;

&lt;p&gt;Today’s Java session was one of those classes where multiple concepts suddenly connected together. Initially, I thought Method Overriding was just about writing the same method in a child class. But as we explored deeper, I understood how concepts like Upcasting, Runtime Polymorphism, Dynamic Method Dispatch, Reference Types, and Object Types all work together behind the scenes.&lt;/p&gt;

&lt;p&gt;In this blog, I’ll share my key takeaways from today's session and the thought process that helped me understand them.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. A Class is the Data Type of an Object
&lt;/h2&gt;

&lt;p&gt;One of the first things I learned today was that a class acts as a data type for objects.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Dog&lt;/span&gt; &lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Dog&lt;/code&gt; is the class&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dog&lt;/code&gt; is the reference variable&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;new Dog()&lt;/code&gt; creates the object&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just like &lt;code&gt;int&lt;/code&gt; is a data type for numbers, a class becomes a data type for objects.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Defining a Child Object as a Parent Reference
&lt;/h2&gt;

&lt;p&gt;The next interesting concept was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Animal&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first, this syntax looked strange.&lt;/p&gt;

&lt;p&gt;Questions that came to my mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why are we creating a Dog object?&lt;/li&gt;
&lt;li&gt;Why is the reference variable Animal?&lt;/li&gt;
&lt;li&gt;Is Java allowing this?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The answer is yes.&lt;/p&gt;

&lt;p&gt;This concept is called &lt;strong&gt;Upcasting&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Since every Dog is an Animal, Java automatically allows a child object to be stored inside a parent reference.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dog → Animal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This conversion happens automatically and is therefore known as &lt;strong&gt;Implicit Upcasting&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. What is Method Overriding?
&lt;/h2&gt;

&lt;p&gt;Method Overriding happens when a child class provides its own implementation of a method already present in the parent class.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Animal&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;makeSound&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Animal Sound"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Animal&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Override&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;makeSound&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Bark"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the &lt;code&gt;Dog&lt;/code&gt; class overrides the &lt;code&gt;makeSound()&lt;/code&gt; method of the &lt;code&gt;Animal&lt;/code&gt; class.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Rules of Method Overriding
&lt;/h2&gt;

&lt;p&gt;One important thing I learned today is that overriding follows strict rules.&lt;/p&gt;

&lt;p&gt;The following must remain the same:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Method Name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Number of Parameters&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Parameter Data Types&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Parameter Order&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;display&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The child class must use the exact same method signature.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. What About Return Types?
&lt;/h2&gt;

&lt;p&gt;Initially, I assumed return types must always be identical.&lt;/p&gt;

&lt;p&gt;That is partially true.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;getName&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can be overridden by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;getName&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, Java also supports something called &lt;strong&gt;Covariant Return Types&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Animal&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nc"&gt;Animal&lt;/span&gt; &lt;span class="nf"&gt;getAnimal&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Animal&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Animal&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Override&lt;/span&gt;
    &lt;span class="nc"&gt;Dog&lt;/span&gt; &lt;span class="nf"&gt;getAnimal&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Dog&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since &lt;code&gt;Dog&lt;/code&gt; is a subclass of &lt;code&gt;Animal&lt;/code&gt;, Java allows this override.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Why Do We Call Method Overriding Runtime Polymorphism?
&lt;/h2&gt;

&lt;p&gt;This was the most important learning of the session.&lt;/p&gt;

&lt;p&gt;Consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Animal&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;makeSound&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The compiler only knows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Animal&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the actual object created is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the method executes, Java checks the actual object type and calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Dog&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;makeSound&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Animal&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;makeSound&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The method decision happens while the program is running.&lt;/p&gt;

&lt;p&gt;That is why it is called &lt;strong&gt;Runtime Polymorphism&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Reference Type vs Object Type
&lt;/h2&gt;

&lt;p&gt;This concept helped me understand Runtime Polymorphism more clearly.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Animal&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reference Type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Animal&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Object Type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Dog&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Important Rule
&lt;/h3&gt;

&lt;p&gt;Reference Type decides:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Which methods are visible at compile time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Object Type decides:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Which overridden method runs at runtime
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This single statement clarified many of my doubts.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Dynamic Method Dispatch
&lt;/h2&gt;

&lt;p&gt;When Java executes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;makeSound&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it performs a runtime check.&lt;/p&gt;

&lt;p&gt;Java asks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What object is this reference pointing to?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the object is Dog:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Dog&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;makeSound&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is executed.&lt;/p&gt;

&lt;p&gt;If the object is Cat:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Cat&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;makeSound&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is executed.&lt;/p&gt;

&lt;p&gt;This mechanism is known as &lt;strong&gt;Dynamic Method Dispatch&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Why Is It Called Runtime Polymorphism?
&lt;/h2&gt;

&lt;p&gt;Another interesting discussion today was:&lt;/p&gt;

&lt;p&gt;Why specifically "Runtime"?&lt;/p&gt;

&lt;p&gt;Because objects are created only when the application runs.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The object memory is allocated during execution.&lt;/p&gt;

&lt;p&gt;Since Java determines the actual method implementation using the runtime object, the behavior can only be finalized while the program is running.&lt;/p&gt;

&lt;p&gt;Hence the name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Runtime Polymorphism
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  10. Practice Exercise
&lt;/h2&gt;

&lt;p&gt;To reinforce these concepts, I implemented an Employee hierarchy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="n"&gt;e1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Developer&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="n"&gt;e2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Tester&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;e1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;work&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;e2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;work&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple example helped me visualize:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upcasting&lt;/li&gt;
&lt;li&gt;Method Overriding&lt;/li&gt;
&lt;li&gt;Dynamic Method Dispatch&lt;/li&gt;
&lt;li&gt;Runtime Polymorphism&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;all working together in a single program.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Today's session completely changed how I view Method Overriding.&lt;/p&gt;

&lt;p&gt;Initially, I thought overriding was just about writing the same method in a child class.&lt;/p&gt;

&lt;p&gt;Now I understand that Method Overriding is the foundation of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Runtime Polymorphism&lt;/li&gt;
&lt;li&gt;Dynamic Method Dispatch&lt;/li&gt;
&lt;li&gt;Upcasting&lt;/li&gt;
&lt;li&gt;Flexible Object-Oriented Design&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The biggest takeaway for me was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Reference Type decides what methods can be called. Object Type decides which overridden method gets executed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That one sentence connected almost every concept we discussed today.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.oracle.com/javase/tutorial/java/IandI/polymorphism.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/IandI/polymorphism.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.oracle.com/javase/tutorial/java/IandI/override.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/IandI/override.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.w3schools.com/java/java_polymorphism.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/java/java_polymorphism.asp&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.geeksforgeeks.org/runtime-polymorphism-in-java/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/runtime-polymorphism-in-java/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/12129200/difference-between-overloading-and-overriding-in-java" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/12129200/difference-between-overloading-and-overriding-in-java&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Python Looping #2: Factorial, Perfect Numbers, and Pattern Printing Explained</title>
      <dc:creator>Ebenezer</dc:creator>
      <pubDate>Thu, 04 Jun 2026 17:27:48 +0000</pubDate>
      <link>https://dev.to/buddingdeveloper/python-looping-2-factorial-perfect-numbers-and-pattern-printing-explained-1kg7</link>
      <guid>https://dev.to/buddingdeveloper/python-looping-2-factorial-perfect-numbers-and-pattern-printing-explained-1kg7</guid>
      <description>&lt;p&gt;Hey Folks! 👋&lt;/p&gt;

&lt;p&gt;Good Day.&lt;/p&gt;

&lt;p&gt;Welcome back to Day 2 of my Python Problem Solving journey.&lt;/p&gt;

&lt;p&gt;A few days ago, our trainer assigned us 15 Python programming problems . Today, I solved another three problems from that list.&lt;/p&gt;

&lt;p&gt;One thing I've started realizing is that programming is less about syntax and more about problem-solving. Once the logic becomes clear, writing the code becomes much easier.&lt;/p&gt;

&lt;p&gt;In this article, I'll walk through three Python problems I solved and share the thinking process behind each solution.&lt;/p&gt;




&lt;h1&gt;
  
  
  Problem 1: Factorial of a Number
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Understanding the Problem
&lt;/h2&gt;

&lt;p&gt;A factorial is the product of all positive integers from a given number down to 1.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5! = 5 × 4 × 3 × 2 × 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before writing any code, I asked myself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If I were solving this manually on paper, what exact steps would I follow?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The answer became the algorithm itself.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with 1.&lt;/li&gt;
&lt;li&gt;Multiply by the current number.&lt;/li&gt;
&lt;li&gt;Move to the next smaller number.&lt;/li&gt;
&lt;li&gt;Repeat until reaching 1.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Python Solution Using While Loop
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;factorial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pseudocode
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;START

number = 5
factorial = 1

WHILE number &amp;gt; 0
    factorial = factorial × number
    number = number - 1
END WHILE

PRINT factorial

STOP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Flowchart
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start
  |
  v
number = 5
factorial = 1
  |
  v
number &amp;gt; 0 ?
  |
 Yes
  |
factorial = factorial * number
  |
number = number - 1
  |
  +------&amp;gt; Repeat
  |
 No
  |
Print factorial
  |
 End
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Alternative Solution Using For Loop
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;factorial&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;factorial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Key Takeaway
&lt;/h2&gt;

&lt;p&gt;When you already know how many iterations are required, a &lt;code&gt;for&lt;/code&gt; loop is usually cleaner and easier to read.&lt;/p&gt;




&lt;h1&gt;
  
  
  Problem 2: Print Odd Numbers First and Then Even Numbers
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Expected Output
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 3 5 7 9 2 4 6 8 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first glance, most people would solve this using two separate loops:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One loop for odd numbers&lt;/li&gt;
&lt;li&gt;One loop for even numbers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted to see whether I could achieve the same result using a single loop.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Thought Process
&lt;/h2&gt;

&lt;p&gt;I imagined the output as two separate queues.&lt;/p&gt;

&lt;p&gt;Odd numbers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 → 3 → 5 → 7 → 9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even numbers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 → 4 → 6 → 8 → 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The challenge wasn't generating the numbers.&lt;/p&gt;

&lt;p&gt;The challenge was switching from the first sequence to the second without creating another loop.&lt;/p&gt;




&lt;h2&gt;
  
  
  Python Solution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 3 5 7 9 2 4 6 8 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  How the Logic Works
&lt;/h2&gt;

&lt;p&gt;The loop starts at 1 and keeps incrementing by 2.&lt;/p&gt;

&lt;p&gt;This generates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 3 5 7 9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After printing 9:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;changes the value to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At that point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;resets the sequence and begins printing even numbers.&lt;/p&gt;

&lt;p&gt;A small condition completely changes the direction of the program.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pseudocode
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;START

number = 1

WHILE number &amp;lt;= 10

    PRINT number

    number = number + 2

    IF number == 11
        number = 2

END WHILE

STOP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Flowchart
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start
  |
  v
number = 1
  |
  v
number &amp;lt;= 10 ?
  |
 Yes
  |
Print number
  |
number = number + 2
  |
number == 11 ?
 / \
Yes No
 |
number = 2
 |
 +------&amp;gt; Repeat
 |
 No
 |
 End
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Key Takeaway
&lt;/h2&gt;

&lt;p&gt;Sometimes a simple condition can eliminate the need for an additional loop.&lt;/p&gt;

&lt;p&gt;Always ask yourself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can I simplify the solution without making it harder to understand?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Problem 3: Perfect Number Program in Python
&lt;/h1&gt;

&lt;h2&gt;
  
  
  What Is a Perfect Number?
&lt;/h2&gt;

&lt;p&gt;A perfect number is a number whose proper divisors add up exactly to the original number.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Divisors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1, 2, 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 + 2 + 3 = 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since the sum equals the original number, 6 is called a Perfect Number.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Analogy
&lt;/h2&gt;

&lt;p&gt;Imagine a group of friends contributing money to buy a gift.&lt;/p&gt;

&lt;p&gt;If the total contribution exactly matches the target amount, everything balances perfectly.&lt;/p&gt;

&lt;p&gt;That's exactly how a perfect number works.&lt;/p&gt;

&lt;p&gt;The sum of all valid contributors (divisors) equals the target amount (the number itself).&lt;/p&gt;




&lt;h2&gt;
  
  
  Python Solution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;496&lt;/span&gt;
&lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;

    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Perfect&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Not Perfect&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  How the Logic Works
&lt;/h2&gt;

&lt;p&gt;The program checks every number from 1 to &lt;code&gt;n - 1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If a number divides the original number without leaving a remainder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it gets added to the running total.&lt;/p&gt;

&lt;p&gt;After all checks are complete, we compare:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If both values match, the number is perfect.&lt;/p&gt;




&lt;h2&gt;
  
  
  Dry Run Using 6
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Divisor&lt;/th&gt;
&lt;th&gt;Added?&lt;/th&gt;
&lt;th&gt;Running Sum&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Final Check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;6 == 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Perfect Number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pseudocode
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;START

number = n
sum = 0

FOR each value from 1 to n - 1

    IF value divides number
        sum = sum + value

END FOR

IF sum equals number
    PRINT Perfect Number
ELSE
    PRINT Not Perfect Number

STOP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Flowchart
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start
  |
  v
sum = 0
i = 1
  |
  v
i &amp;lt; number ?
  |
 Yes
  |
number % i == 0 ?
 / \
Yes No
 |
sum += i
 |
i += 1
 |
 +------&amp;gt; Repeat
 |
 No
 |
sum == number ?
 / \
Yes No
 |   |
Perfect
     |
Not Perfect
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  What I Learned from These Problems
&lt;/h1&gt;

&lt;p&gt;Although these programs are small, they helped me strengthen some important programming fundamentals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loops&lt;/li&gt;
&lt;li&gt;Conditional Statements&lt;/li&gt;
&lt;li&gt;Mathematical Logic&lt;/li&gt;
&lt;li&gt;Pattern Generation&lt;/li&gt;
&lt;li&gt;Problem Decomposition&lt;/li&gt;
&lt;li&gt;Dry Running Code&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  * Converting Logic into Programs
&lt;/h2&gt;

&lt;h1&gt;
  
  
  My Current Problem-Solving Workflow
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Problem
    ↓
Understand the Requirement
    ↓
Break It Into Smaller Steps
    ↓
Write Pseudocode
    ↓
Code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This workflow has helped me reduce mistakes and understand programming concepts much more deeply.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;If you're new to this series, check out Part 1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/buddingdeveloper/python-for-beginners-how-i-solved-two-classic-problems-in-multiple-ways-with-flowcharts-30ie"&gt;https://dev.to/buddingdeveloper/python-for-beginners-how-i-solved-two-classic-problems-in-multiple-ways-with-flowcharts-30ie&lt;/a&gt;&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
