<?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: MOHAMED ABDULLAH</title>
    <description>The latest articles on DEV Community by MOHAMED ABDULLAH (@mohamed_abdullah_5ffbf6b6).</description>
    <link>https://dev.to/mohamed_abdullah_5ffbf6b6</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3225626%2F62ac4464-9ac3-4060-b744-becb7050e192.jpg</url>
      <title>DEV Community: MOHAMED ABDULLAH</title>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohamed_abdullah_5ffbf6b6"/>
    <language>en</language>
    <item>
      <title>Introduction to HTML</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Tue, 08 Jul 2025 13:28:46 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/introduction-to-html-4mg3</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/introduction-to-html-4mg3</guid>
      <description>&lt;p&gt;HTML (HyperText Markup Language) is the standard language used to create webpages. It tells the browser how to display text, images, links, and other content on a webpage.&lt;/p&gt;

&lt;p&gt;HTML is not a programming language; it's a markup language. It uses tags to describe the structure of content.&lt;/p&gt;

&lt;p&gt;Basic Structure of an HTML Page&lt;/p&gt;

&lt;p&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br&gt;
&lt;br&gt;
  &lt;/p&gt;
&lt;br&gt;
    Payilagam Official Webpage&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
    &lt;h1&gt;Welcome to My Website&lt;/h1&gt;
&lt;br&gt;
    &lt;p&gt;This is my first webpage using HTML!&lt;/p&gt;
&lt;br&gt;
  &lt;br&gt;


&lt;p&gt;&amp;lt;!DOCTYPE html&amp;gt;: Declares that this is an HTML5 document.&lt;/p&gt;

&lt;p&gt;: The root element of an HTML page.&lt;/p&gt;

: Contains meta-information like the title.

: Contains the visible content on the page

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tag&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Headings (h1 is the largest, h6 is the smallest)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Paragraph&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;a href=""&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Anchor (link to other pages or websites)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;img src=""&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Displays an image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;ol&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Lists: unordered, ordered, and list items&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A container used to group elements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Line break&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;HTTP vs HTTPS&lt;/p&gt;

&lt;p&gt;When visiting websites, you may notice URLs starting with http:// or https://. Let’s understand the difference:&lt;/p&gt;

&lt;p&gt;HTTP (HyperText Transfer Protocol)&lt;br&gt;
Protocol used to transfer data over the web.&lt;/p&gt;

&lt;p&gt;Data is not encrypted, which means it's less secure.&lt;/p&gt;

&lt;p&gt;Suitable for non-sensitive browsing like reading blogs or news.&lt;/p&gt;

&lt;p&gt;HTTPS (HTTP Secure)&lt;br&gt;
The secure version of HTTP.&lt;/p&gt;

&lt;p&gt;Uses SSL/TLS encryption to protect data between your browser and the server.&lt;/p&gt;

&lt;p&gt;Ensures data privacy, integrity, and security.&lt;/p&gt;

&lt;p&gt;Indicated by a padlock icon 🔒 in the browser address bar.&lt;/p&gt;

&lt;p&gt;🔐 Always prefer HTTPS for logging in, online payments, or sensitive transactions.&lt;/p&gt;

&lt;p&gt;What Happens When You Visit an HTML Page?&lt;br&gt;
You enter a URL (like &lt;a href="https://example.com" rel="noopener noreferrer"&gt;https://example.com&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The browser sends an HTTP/HTTPS request to the web server.&lt;/p&gt;

&lt;p&gt;The server responds with an HTML page.&lt;/p&gt;

&lt;p&gt;The browser renders the HTML into visual content.&lt;/p&gt;

&lt;p&gt;Official HTML Reference :&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    1 : https://www.w3.org/TR/html/
&lt;/code&gt;&lt;/pre&gt;

</description>
    </item>
    <item>
      <title>Arrays in Java</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Fri, 27 Jun 2025 10:00:16 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/arrays-in-java-4haj</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/arrays-in-java-4haj</guid>
      <description>&lt;p&gt;In Java, an array is a powerful and foundational data structure that allows  to store multiple values of the same type in a single variable. Arrays provide a systematic way to manage large collections of data efficiently, especially when the number of elements is known in advance.&lt;/p&gt;

&lt;p&gt;An array in Java is a container object that holds a fixed number of elements of a single data type. Each element in the array is accessed using its index, which starts from 0.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;/p&gt;

&lt;p&gt;dataType[] arrayName = new dataType[size];&lt;/p&gt;

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

&lt;p&gt;int[] scores = new int[5];  // Declaration with size 5&lt;br&gt;
scores[0] = 85;  &lt;/p&gt;

&lt;p&gt;Types of Arrays&lt;br&gt;
Java supports two primary types of arrays:&lt;/p&gt;

&lt;p&gt;Single-Dimensional Arrays&lt;/p&gt;

&lt;p&gt;A linear list of elements.&lt;/p&gt;

&lt;p&gt;Example: int[] numbers = {1, 2, 3, 4};&lt;/p&gt;

&lt;p&gt;Multi-Dimensional Arrays&lt;/p&gt;

&lt;p&gt;Arrays of arrays (e.g., 2D arrays or matrices).&lt;/p&gt;

&lt;p&gt;Example: int[][] matrix = new int[3][3];&lt;/p&gt;

&lt;p&gt;Array Initialization Methods&lt;/p&gt;

&lt;p&gt;Static Initialization:&lt;br&gt;
String[] fruits = {"Apple", "Banana", "Cherry"};&lt;/p&gt;

&lt;p&gt;Dynamic Initialization:&lt;br&gt;
double[] prices = new double[3];&lt;br&gt;
prices[0] = 9.99;&lt;/p&gt;

&lt;p&gt;Accessing Array Elements&lt;/p&gt;

&lt;p&gt;Elements are accessed by their index position:&lt;/p&gt;

&lt;p&gt;System.out.println(scores[2]);  // Prints the 3rd element&lt;/p&gt;

&lt;p&gt;Common Operations on Arrays&lt;br&gt;
Traversal using for or for-each loop&lt;/p&gt;

&lt;p&gt;Sorting using Arrays.sort(array)&lt;/p&gt;

&lt;p&gt;Searching using Arrays.binarySearch(array, key)&lt;/p&gt;

&lt;p&gt;Cloning with array.clone() &lt;/p&gt;

&lt;p&gt;public class ArrayExample {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        int[] numbers = {10, 20, 30, 40, 50};&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    for (int i = 0; i &amp;lt; numbers.length; i++) {
        System.out.println("Element at index " + i + ": " + numbers[i]);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&gt;
Element at index 0: 10&lt;br&gt;
Element at index 1: 20&lt;br&gt;
Element at index 2: 30&lt;br&gt;
Element at index 3: 40&lt;br&gt;
Element at index 4: 50&lt;/p&gt;

&lt;p&gt;Key Characteristics&lt;br&gt;
Arrays in Java are objects.&lt;/p&gt;

&lt;p&gt;The length of an array is fixed and cannot be changed once declared.&lt;/p&gt;

&lt;p&gt;The property array.length gives the total number of elements.&lt;/p&gt;

&lt;p&gt;Java automatically initializes array elements with default values:&lt;/p&gt;

&lt;p&gt;0 for numeric types&lt;/p&gt;

&lt;p&gt;false for boolean&lt;/p&gt;

&lt;p&gt;null for reference types&lt;/p&gt;

&lt;p&gt;Official reference link:&lt;br&gt;
1 :&lt;a href="https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>8 key features of Java</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Mon, 23 Jun 2025 12:42:45 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/8-key-features-of-java-4abl</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/8-key-features-of-java-4abl</guid>
      <description>&lt;p&gt;Object-Oriented&lt;br&gt;
Everything in Java is treated as an object.&lt;/p&gt;

&lt;p&gt;Supports concepts like Encapsulation, Inheritance, Polymorphism, and Abstraction.&lt;/p&gt;

&lt;p&gt;Platform Independent&lt;br&gt;
Java code is compiled into bytecode, which runs on any system that has a Java Virtual Machine (JVM).&lt;/p&gt;

&lt;p&gt;"Write Once, Run Anywhere" (WORA) capability.&lt;/p&gt;

&lt;p&gt;Simple and Easy to Learn&lt;br&gt;
Syntax is clean and similar to C/C++ but removes complex features like pointers and operator overloading.&lt;/p&gt;

&lt;p&gt;Secure&lt;br&gt;
No direct memory access (no pointers).&lt;/p&gt;

&lt;p&gt;Uses bytecode verification, exception handling, and access modifiers for secure execution.&lt;/p&gt;

&lt;p&gt;Robust&lt;br&gt;
Strong memory management (Garbage Collection).&lt;/p&gt;

&lt;p&gt;Exception handling and type checking help build reliable applications.&lt;/p&gt;

&lt;p&gt;Multithreaded&lt;br&gt;
Supports multiple threads of execution using the Thread class or Runnable interface.&lt;/p&gt;

&lt;p&gt;Helps in developing concurrent and responsive applications.&lt;/p&gt;

&lt;p&gt;High Performance&lt;br&gt;
Although slower than C/C++, Java’s performance is improved using JIT (Just-In-Time) compiler.&lt;/p&gt;

&lt;p&gt;Distributed&lt;br&gt;
Java provides APIs like RMI (Remote Method Invocation) and Socket Programming to build distributed systems (network-based applications).&lt;/p&gt;

</description>
    </item>
    <item>
      <title>prime numbers in java</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Fri, 20 Jun 2025 12:05:32 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/prime-numbers-in-java-5ggn</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/prime-numbers-in-java-5ggn</guid>
      <description>&lt;p&gt;A prime number is a number greater than 1 that has only two factors  1 and itself.&lt;/p&gt;

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

&lt;p&gt;5 is prime → factors: 1, 5&lt;/p&gt;

&lt;p&gt;6 is not prime → factors: 1, 2, 3, 6&lt;/p&gt;

&lt;p&gt;a Java program to print whether each number from 150 to 300 is a prime number or not.&lt;/p&gt;

&lt;p&gt;public class Numbers {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Method to check if a number is prime
public void CheckPrime(int j) {
    int i = 1;          // Start checking from 1
    int count = 0;      // Counter to count number of factors

    while (i &amp;lt;= j) {
        if (j % i == 0) {       // If j is divisible by i
            count = count + 1;  // Increase the count
        }
        i++;                    // Move to next i
    }

    // After loop ends, check if the number has exactly 2 factors
    if (count == 2) {
        System.out.println(j + " is a prime number");
    } else {
        System.out.println(j + " is not a prime number");
    }
}

// Main method to check numbers from 150 to 300
public static void main(String[] args) {
    Numbers num = new Numbers(); // Create object of the class
    int j = 150;

    while (j &amp;lt;= 300) {
        num.CheckPrime(j); // Call the CheckPrime method
        j++;               // Move to the next number
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;OUTPUT  Sample:&lt;/p&gt;

&lt;p&gt;150 is not a prime number&lt;br&gt;&lt;br&gt;
151 is a prime number&lt;br&gt;&lt;br&gt;
152 is not a prime number&lt;br&gt;&lt;br&gt;
...&lt;br&gt;&lt;br&gt;
199 is a prime number&lt;br&gt;&lt;br&gt;
...&lt;br&gt;&lt;br&gt;
300 is not a prime number&lt;/p&gt;

&lt;p&gt;Step-by-Step Explanation&lt;/p&gt;

&lt;p&gt;public void CheckPrime(int j)&lt;br&gt;
A method that takes one number j and checks if it is prime.&lt;/p&gt;

&lt;p&gt;Uses a while loop to check how many numbers divide j completely (using j % i == 0).&lt;/p&gt;

&lt;p&gt;If count == 2, it's a prime number.&lt;/p&gt;

&lt;p&gt;Loop from 150 to 300&lt;/p&gt;

&lt;p&gt;int j = 150;&lt;br&gt;
while (j &amp;lt;= 300) {&lt;br&gt;
    num.CheckPrime(j);&lt;br&gt;
    j++;&lt;br&gt;
}&lt;br&gt;
This loop goes through each number from 150 to 300, calling the CheckPrime() method on each value of j.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Sum of Digits in Java</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Thu, 19 Jun 2025 11:34:50 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/sum-of-digits-in-java-5anh</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/sum-of-digits-in-java-5anh</guid>
      <description>&lt;p&gt;What is "Sum of Digits"?&lt;br&gt;
The Sum of Digits of a number means adding all individual digits of that number.&lt;/p&gt;

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

&lt;p&gt;Input: 123&lt;/p&gt;

&lt;p&gt;Calculation: 1 + 2 + 3 = 6&lt;/p&gt;

&lt;p&gt;Key Concepts Used&lt;/p&gt;

&lt;p&gt;Concept Description&lt;br&gt;
Modulo %    Gives the last digit of a number. 123 % 10 = 3&lt;br&gt;
Division /  Removes the last digit. 123 / 10 = 12&lt;br&gt;
Loops           Used to keep dividing and summing digits until the number &lt;br&gt;
                   becomes 0&lt;br&gt;
Type            Works best with int, but can be extended to long, &lt;br&gt;
                BigInteger, etc.&lt;/p&gt;

&lt;p&gt;Algorithm Steps&lt;br&gt;
Initialize a variable to store the sum (e.g., sum = 0)&lt;/p&gt;

&lt;p&gt;Use a while loop to repeat until the number becomes 0&lt;/p&gt;

&lt;p&gt;In each iteration:&lt;/p&gt;

&lt;p&gt;Get the last digit using number % 10&lt;/p&gt;

&lt;p&gt;Add the digit to sum&lt;/p&gt;

&lt;p&gt;Remove the last digit using number = number / 10&lt;/p&gt;

&lt;p&gt;Print or return the result&lt;/p&gt;

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

&lt;p&gt;public class SumOfDigits {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void main(String[] args) {
    int number = 12345; // Example input
    int sum = 0;

    while (number != 0) {
        int digit = number % 10; // Get last digit
        sum += digit;            // Add to sum
        number = number / 10;    // Remove last digit
    }

    System.out.println("Sum of digits: " + sum);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

</description>
    </item>
    <item>
      <title>flag Using boolean in Java</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Wed, 18 Jun 2025 10:55:11 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/flag-using-boolean-in-java-ek6</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/flag-using-boolean-in-java-ek6</guid>
      <description>&lt;p&gt;In Java programming, a flag is often a boolean variable (true or false) used to track or control the flow of logic in loops and conditions.&lt;/p&gt;

&lt;p&gt;It's like raising a "red flag" to say something happened.&lt;/p&gt;

&lt;p&gt;What is a Flag?&lt;/p&gt;

&lt;p&gt;A flag is a temporary indicator.&lt;/p&gt;

&lt;p&gt;It’s usually declared like this:&lt;/p&gt;

&lt;p&gt;boolean flag = true;  // or false&lt;/p&gt;

&lt;p&gt;We change this flag based on a condition, then check its value after a loop or block to decide what to do next.&lt;/p&gt;

&lt;p&gt;STRUCTURE:&lt;/p&gt;

&lt;p&gt;// 1. Declare and initialize&lt;br&gt;
boolean flag = true; // or false&lt;/p&gt;

&lt;p&gt;// 2. Run your loop or logic&lt;br&gt;
while (condition) {&lt;br&gt;
    if (someConditionIsMet) {&lt;br&gt;
        flag = false; // or true&lt;br&gt;
        break;&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;// 3. Use the flag in if-else&lt;br&gt;
if (flag) {&lt;br&gt;
    // Do something if the flag is true&lt;br&gt;
} else {&lt;br&gt;
    // Do something else if the flag is false&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;exapmle :&lt;/p&gt;

&lt;p&gt;public class PrimeChecker {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        int num = 29;&lt;br&gt;
        int i = 2;&lt;br&gt;
        boolean flag = true; // Assume prime&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    while (i &amp;lt;= num / 2) {
        if (num % i == 0) {
            flag = false; // Found a factor, not prime
            break;
        }
        i++;
    }

    if (flag &amp;amp;&amp;amp; num &amp;gt; 1) {
        System.out.println(num + " is a prime number");
    } else {
        System.out.println(num + " is not a prime number");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;output :&lt;/p&gt;

&lt;p&gt;29  is a prime number&lt;/p&gt;

&lt;p&gt;reference link:&lt;br&gt;
   1: &lt;a href="https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2: &lt;a href="https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>while Loop in Java</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Fri, 13 Jun 2025 15:55:53 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/while-loop-in-java-5231</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/while-loop-in-java-5231</guid>
      <description>&lt;p&gt;What is a while Loop?&lt;/p&gt;

&lt;p&gt;A while loop is used to repeat a block of code as long as a specified condition is true. It checks the condition before executing the loop body, which makes it an entry-controlled loop.&lt;/p&gt;

&lt;p&gt;structure:&lt;br&gt;
initialization;  // Step 1&lt;/p&gt;

&lt;p&gt;while (condition) {  // Step 2&lt;br&gt;
    // code block to be executed  // Step 3&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;increment/decrement;  // Step 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
public class WhileExample {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        int i = 1; // Initialization&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    while (i &amp;lt;= 5) { // Condition
        System.out.println(i); // Code block
        i++; // Increment – very important!
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Explanation of the 4 Parts:&lt;/p&gt;

&lt;p&gt;Initialization: int i = 1;&lt;/p&gt;

&lt;p&gt;Condition: i &amp;lt;= 5&lt;/p&gt;

&lt;p&gt;Action (body): System.out.println(i);&lt;/p&gt;

&lt;p&gt;Increment/Decrement: i++ (so the loop moves forward)&lt;/p&gt;

&lt;p&gt;Without Increment/Decrement – Infinite Loop Danger&lt;/p&gt;

&lt;p&gt;int i = 1;&lt;/p&gt;

&lt;p&gt;while (i &amp;lt;= 5) {&lt;br&gt;
    System.out.println(i); //  No increment here&lt;br&gt;
}&lt;br&gt;
 This will print 1 forever! Because i never changes, the condition i &amp;lt;= 5 stays true&lt;/p&gt;

&lt;p&gt;With Decrement Example – Countdown&lt;/p&gt;

&lt;p&gt;int count = 5;&lt;/p&gt;

&lt;p&gt;while (count &amp;gt; 0) {&lt;br&gt;
    System.out.println("Countdown: " + count);&lt;br&gt;
    count--; // Decrement&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;reference link :&lt;/p&gt;

&lt;p&gt;1: &lt;a href="https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Use .gitignore in Git</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Fri, 13 Jun 2025 11:10:19 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/how-to-use-gitignore-in-git-14b9</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/how-to-use-gitignore-in-git-14b9</guid>
      <description>&lt;p&gt;When working with Git, you might have files (like .class, .log, or temp files) that you don’t want to upload to GitLab or GitHub. That’s where .gitignore comes in handy.&lt;/p&gt;

&lt;p&gt;What is .gitignore?&lt;br&gt;
The .gitignore file tells Git which files or folders to ignore (not track).&lt;/p&gt;

&lt;p&gt;How to Set Up .gitignore&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a .gitignore file
In your project root folder (same place where .git is), create a new file:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;.gitignore&lt;/p&gt;

&lt;p&gt;Add file patterns to ignore&lt;br&gt;
Example .gitignore:&lt;/p&gt;

&lt;p&gt;*.class       # ignore all Java compiled class files&lt;br&gt;
*.log         # ignore all log files&lt;br&gt;
/temp/        # ignore temp folder&lt;/p&gt;

&lt;p&gt;Remove already tracked files (if needed)&lt;/p&gt;

&lt;p&gt;If .class files are already tracked, Git won't ignore them just by adding to .gitignore.&lt;/p&gt;

&lt;p&gt;Run this to remove them from tracking:&lt;/p&gt;

&lt;p&gt;git rm --cached *.class&lt;/p&gt;

&lt;p&gt;Commit and push&lt;/p&gt;

&lt;p&gt;git add .gitignore&lt;br&gt;
git commit -m "Added .gitignore file"&lt;/p&gt;

&lt;p&gt;git push&lt;br&gt;
Done! Git will now ignore those files in future commits.&lt;/p&gt;

&lt;p&gt;referel links :&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 :Link: https://git-scm.com/docs/gitignore
2 : Link: https://github.com/github/gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>if-else in Java</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Wed, 11 Jun 2025 06:05:05 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/if-else-in-java-gkb</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/if-else-in-java-gkb</guid>
      <description>&lt;p&gt;In Java programming, making decisions is essential. That’s where if-else statements come in! They help your program make choices based on certain conditions.&lt;/p&gt;

&lt;p&gt;if-else is a control flow statement that tells your program:&lt;/p&gt;

&lt;p&gt;“Do this if a condition is true. Otherwise, do something else.”&lt;/p&gt;

&lt;p&gt;Syntax of if-else in Java&lt;/p&gt;

&lt;p&gt;if (condition) {&lt;br&gt;
    // Executes if condition is true&lt;br&gt;
} else {&lt;br&gt;
    // Executes if condition is false&lt;br&gt;
}&lt;/p&gt;

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

&lt;p&gt;public class Bignumber {&lt;br&gt;
    int a ;&lt;br&gt;
    int b ;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bignumber (int a, int b){
 this.a = a;
 this.b = b;

}
public void findbig (){
    if (a&amp;gt;b){
        System.out.println("a is big ");
    }
    else{
        System.out.println("b is big");
    }
}
public static void main(String[] args) {
    Bignumber big = new Bignumber(100,200 );
    big.findbig();

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;output:&lt;/p&gt;

&lt;p&gt;b is big&lt;/p&gt;

&lt;p&gt;if-else-if is a control flow statement that allows your program to choose between multiple conditions.&lt;/p&gt;

&lt;p&gt;It tells your program:&lt;/p&gt;

&lt;p&gt;“Check this first. If it’s true, do it.&lt;br&gt;
If not, check the next one.&lt;br&gt;
If nothing is true, do the final else.”&lt;/p&gt;

&lt;p&gt;Syntax of if-else-if in Java&lt;/p&gt;

&lt;p&gt;if (condition1) {&lt;br&gt;
    // Executes if condition1 is true&lt;br&gt;
} else if (condition2) {&lt;br&gt;
    // Executes if condition2 is true&lt;br&gt;
} else {&lt;br&gt;
    // Executes if none are true&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;EXAMPLE:&lt;/p&gt;

&lt;p&gt;public class Bignumber {&lt;br&gt;
    int a;&lt;br&gt;
    int b;&lt;br&gt;
    int c;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bignumber(int a, int b, int c) {
    this.a = a;
    this.b = b;
    this.c = c;
}

public void findbig() {
    if (a &amp;gt; b &amp;amp;&amp;amp; a &amp;gt; c) {
        System.out.println("a is big");
    } else if (b &amp;gt; a &amp;amp;&amp;amp; b &amp;gt; c) {
        System.out.println("b is big");
    } else if (c &amp;gt; a &amp;amp;&amp;amp; c &amp;gt; b) {
        System.out.println("c is big");
    } 

}

public static void main(String[] args) {
    Bignumber big = new Bignumber(100, 200, 150);
    big.findbig();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

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

&lt;p&gt;b is big&lt;/p&gt;

&lt;p&gt;referel links :&lt;/p&gt;

&lt;p&gt;1 : &lt;a href="https://docs.oracle.com/javase/tutorial/java/nutsandbolts/if.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/nutsandbolts/if.html&lt;/a&gt;&lt;br&gt;
  2 :  &lt;a href="https://docs.oracle.com/javase/specs/jls/se17/html/jls-14.html#jls-14.9" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/specs/jls/se17/html/jls-14.html#jls-14.9&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>swapping</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Wed, 11 Jun 2025 05:50:52 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/swapping-ecp</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/swapping-ecp</guid>
      <description>&lt;p&gt;Swapping means exchanging the values of two variables.&lt;br&gt;
For example:&lt;/p&gt;

&lt;p&gt;Before swap: a = 10, b = 20&lt;/p&gt;

&lt;p&gt;After swap: a = 20, b = 10&lt;/p&gt;

&lt;p&gt;public class Swapping {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a ;
int b ;

Swapping (int a , int b ){

    this.a = a;
    this.b = b;


}

public void swap(){
    int temp;
     temp  = a ;
    a = b ;
     b = temp ;

}
public static void main(String[] args) {
    Swapping big = new Swapping (10,20);
   System.out.println("before swap");
   System.out.println(big.a);
   System.err.println(big.b);
   big.swap();
    System.out.println("after swap");
   System.out.println(big.a);
   System.err.println(big.b);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Explanation&lt;br&gt;
int a, b: These are instance variables used to store the values.&lt;/p&gt;

&lt;p&gt;Swapping(int a, int b): This is a constructor that sets the initial values of a and b.&lt;/p&gt;

&lt;p&gt;swap(): A method that uses a temporary variable to swap the values of a and b.&lt;/p&gt;

&lt;p&gt;main(): The program execution starts here. It creates an object and demonstrates the swap.&lt;/p&gt;

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

&lt;p&gt;Before swap:&lt;br&gt;
a = 10&lt;br&gt;
b = 20&lt;/p&gt;

&lt;p&gt;After swap:&lt;br&gt;
a = 20&lt;br&gt;
b = 10&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Encapsulation</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Tue, 10 Jun 2025 06:04:52 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/encapsulation-44l9</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/encapsulation-44l9</guid>
      <description>&lt;p&gt;Encapsulation is the process of hiding the internal details of a class and only showing essential information through methods. It’s like putting important data inside a capsule and giving access through controlled ways.&lt;/p&gt;

&lt;p&gt;Key Features of Encapsulation&lt;/p&gt;

&lt;p&gt;Data members (variables) are marked private&lt;/p&gt;

&lt;p&gt;Access to them is given through public getter and setter methods&lt;/p&gt;

&lt;p&gt;Helps to maintain control over data&lt;/p&gt;

&lt;p&gt;Improves modularity and code security&lt;/p&gt;

&lt;p&gt;Structure of Encapsulation&lt;/p&gt;

&lt;p&gt;class ClassName {&lt;br&gt;
    // 1. Private variables (hidden from outside)&lt;br&gt;
    private DataType variable;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// 2. Public getter method
public DataType getVariable() {
    return variable;
}

// 3. Public setter method
public void setVariable(DataType value) {
    this.variable = value;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Benefits of Encapsulation&lt;/p&gt;

&lt;p&gt;Security    Data is not directly accessible by outside classes&lt;/p&gt;

&lt;p&gt;Control         You decide how data is accessed or modified&lt;/p&gt;

&lt;p&gt;Flexibility Easy to change one part of the code without affecting &lt;br&gt;
                others&lt;/p&gt;

&lt;p&gt;Reusability Encapsulated classes are easier to reuse in otherprograms&lt;/p&gt;

&lt;p&gt;EXAMPLE:&lt;/p&gt;

&lt;p&gt;public class Student {&lt;br&gt;
    private String name;&lt;br&gt;
    private int age;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Getter for name
public String getName() {
    return name;
}

// Setter for name
public void setName(String name) {
    this.name = name;
}

// Getter for age
public int getAge() {
    return age;
}

// Setter for age
public void setAge(int age) {
    this.age = age;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        Student student = new Student();&lt;br&gt;
        student.setName("Abdullah");&lt;br&gt;
        student.setAge(22);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    System.out.println("Student Name: " + student.getName());
    System.out.println("Student Age: " + student.getAge());
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
  output:&lt;/p&gt;

&lt;p&gt;Student Name: Abdullah&lt;br&gt;
Student Age: 22&lt;/p&gt;

&lt;p&gt;referel links :&lt;/p&gt;

&lt;p&gt;1 : &lt;a href="https://docs.oracle.com/javase/tutorial/java/javaOO/encaps.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/javaOO/encaps.html&lt;/a&gt;&lt;br&gt;
   2 : &lt;a href="https://www.w3schools.com/java/java_encapsulation.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/java/java_encapsulation.asp&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Constructor</title>
      <dc:creator>MOHAMED ABDULLAH</dc:creator>
      <pubDate>Fri, 06 Jun 2025 05:17:58 +0000</pubDate>
      <link>https://dev.to/mohamed_abdullah_5ffbf6b6/constructor-36h1</link>
      <guid>https://dev.to/mohamed_abdullah_5ffbf6b6/constructor-36h1</guid>
      <description>&lt;p&gt;Constructors are special methods in Java used to initialize objects. Unlike regular methods, constructors have the same name as the class and do not have a return type.&lt;/p&gt;

&lt;p&gt;A constructor is automatically called when an object is created. It sets initial values for object attributes.&lt;/p&gt;

&lt;p&gt;Key Points:&lt;br&gt;
Constructor name = class name&lt;/p&gt;

&lt;p&gt;No return type (not even void)&lt;/p&gt;

&lt;p&gt;Called automatically when an object is created&lt;/p&gt;

&lt;p&gt;Can be default, no-argument, or parameterized&lt;/p&gt;

&lt;p&gt;Default Constructor (Provided by Compiler)&lt;br&gt;
Explanation:&lt;br&gt;
If you don’t write any constructor, Java automatically adds a no-argument constructor called the default constructor.&lt;/p&gt;

&lt;p&gt;It does nothing but allows object creation.&lt;/p&gt;

&lt;p&gt;When to use:&lt;br&gt;
When no special initialization is needed for the object.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Default Constructor (Provided by Compiler)
Structure:
You don’t need to write this. If no constructor is defined, Java will create this for you behind the scenes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;structure:&lt;/p&gt;

&lt;p&gt;class MyClass {&lt;br&gt;
    // No constructor defined, so compiler adds:&lt;br&gt;
    // MyClass() { }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Used like this:&lt;/p&gt;

&lt;p&gt;MyClass obj = new MyClass(); // compiler-created default constructor&lt;/p&gt;

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

&lt;p&gt;class Book {&lt;br&gt;
    void show() {&lt;br&gt;
        System.out.println("This is a book.");&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        Book b1 = new Book(); // default constructor is used&lt;br&gt;
        b1.show();&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
This is a book.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;No-Argument Constructor (User-defined)
Explanation:
This is a constructor you write yourself with no parameters.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can add custom logic inside it (like printing or initializing values).&lt;/p&gt;

&lt;p&gt;When to use:&lt;br&gt;
When you want to execute some logic when the object is created, but no input is needed.&lt;br&gt;
 Structure:&lt;/p&gt;

&lt;p&gt;class MyClass {&lt;br&gt;
    MyClass() {&lt;br&gt;
        // constructor body&lt;br&gt;
        System.out.println("No-arg constructor called");&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
Used like this:&lt;/p&gt;

&lt;p&gt;MyClass obj = new MyClass(); // calls no-arg constructor&lt;/p&gt;

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

&lt;p&gt;class Car {&lt;br&gt;
    Car() {&lt;br&gt;
        System.out.println("Car is ready!");&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        Car c1 = new Car(); // no-arg constructor is called&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

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

&lt;p&gt;Car is ready!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parameterized Constructor
Explanation:
This constructor accepts parameters so you can initialize object variables during object creation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Useful for setting different values for different objects.&lt;/p&gt;

&lt;p&gt;When to use:&lt;br&gt;
When you want to assign values to object fields at the time of creation.&lt;/p&gt;

&lt;p&gt;Parameterized Constructor&lt;br&gt;
Structure:&lt;/p&gt;

&lt;p&gt;class MyClass {&lt;br&gt;
    int x;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MyClass(int value) {
    x = value;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
Used like this:&lt;/p&gt;

&lt;p&gt;MyClass obj = new MyClass(10); // calls parameterized constructor&lt;/p&gt;

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

&lt;p&gt;class Student {&lt;br&gt;
    String name;&lt;br&gt;
    int age;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Student(String n, int a) {
    name = n;
    age = a;
}

void display() {
    System.out.println("Name: " + name + ", Age: " + age);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        Student s1 = new Student("Abdullah", 22);&lt;br&gt;
        s1.display();&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

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

&lt;p&gt;Name: Abdullah, Age: 22&lt;/p&gt;

&lt;p&gt;reference link 1 :&lt;br&gt;
&lt;a href="https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;reference link 2:&lt;br&gt;
&lt;a href="https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-8.8" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-8.8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;reference link 3 :&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/constructors-in-java/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/constructors-in-java/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
