<?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: SIVAGANESH L</title>
    <description>The latest articles on DEV Community by SIVAGANESH L (@pumpkin1996).</description>
    <link>https://dev.to/pumpkin1996</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%2F3208396%2Fc20f80e9-8ab8-4dcb-bd70-bb7366bad5c5.png</url>
      <title>DEV Community: SIVAGANESH L</title>
      <link>https://dev.to/pumpkin1996</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pumpkin1996"/>
    <language>en</language>
    <item>
      <title>Understanding Java Arrays: A Beginner's Perspective</title>
      <dc:creator>SIVAGANESH L</dc:creator>
      <pubDate>Fri, 27 Jun 2025 09:58:32 +0000</pubDate>
      <link>https://dev.to/pumpkin1996/understanding-java-arrays-a-beginners-perspective-2dmp</link>
      <guid>https://dev.to/pumpkin1996/understanding-java-arrays-a-beginners-perspective-2dmp</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is an Array in Java?&lt;/strong&gt;&lt;br&gt;
In simple terms, an array is like a row of containers that can store multiple values of the same type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Do We Use Arrays in Java?&lt;/strong&gt;&lt;br&gt;
Imagine you want to store the marks of 3 students. You might do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int mark1 = 10;
int mark2 = 20;
int mark3 = 30;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But what if there are 100 students? &lt;/p&gt;

&lt;p&gt;Using so many separate variables becomes difficult to write, read, and manage. That’s why we use arrays.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When we Should Use an Array?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You know how many values you need to store.&lt;/p&gt;

&lt;p&gt;All values are of the same type (e.g. all integers, all strings).&lt;/p&gt;

&lt;p&gt;You want to loop through the data easily.&lt;/p&gt;

&lt;p&gt;You need fast access to elements using index numbers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int[] numbers = {1, 2, 3, 4, 5}; //Here, numbers is an array that holds 5 integers.
String[] fruits = {"Apple", "Banana", "Mango"};
boolean[] flags = {true, false, true};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to Declare an Array&lt;/strong&gt;&lt;br&gt;
There are two main steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Declare the array:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int[] myArray;            // Declaration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Initialize it with values or size:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myArray = new int[3];     // Initialization with size
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also do both in one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int[] myArray = new int[3];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Storing Values in an Array:&lt;/strong&gt;&lt;br&gt;
Array uses indexes to store values and index starts from 0.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myArray[0] = 10;
myArray[1] = 20;
myArray[2] = 30;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Array looks like [10,20,30]&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;System.out.println(myArray[1]); //Output: 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looping Through Arrays&lt;br&gt;
&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; myArray.length; i++) {
    System.out.println(myArray[i]);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When Not to Use Arrays?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You don’t know the size of elements in advance.&lt;/p&gt;

&lt;p&gt;You need to frequently add or remove elements.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Shallow Copy Vs Deep Copy</title>
      <dc:creator>SIVAGANESH L</dc:creator>
      <pubDate>Fri, 13 Jun 2025 10:08:26 +0000</pubDate>
      <link>https://dev.to/pumpkin1996/shallow-copy-vs-deep-copy-o5p</link>
      <guid>https://dev.to/pumpkin1996/shallow-copy-vs-deep-copy-o5p</guid>
      <description>&lt;p&gt;Shallow Copy:&lt;br&gt;
A shallow copy of an object is a copy where only the references to the objects are copied, not the objects themselves. This means that the new object will share the same references to the objects inside the original object. If the internal objects are modified, the changes will be reflected in both the original and the copied objects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ShallowEx {
    int a;
    int b;
    public ShallowEx(){
        this.a =100;
        this.b = 200;
    }
      }

public class ShallowCopyMain {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        ShallowEx obj1 = new ShallowEx();
        System.out.println("Before Copying");
        System.out.println(obj1.a);
        System.out.println(obj1.b);
        //Copying Objects
        ShallowEx obj2= obj1;
        System.out.println(obj2.a);
        System.out.println(obj2.b);
        obj2.a=1000;
        obj2.b=2000;
        System.out.println("After Copying");
        System.out.println("object1value "+obj1.a);
        System.out.println("object1value "+obj1.b);
        System.out.println("object1value "+obj2.a);
        System.out.println("object1value "+obj2.b);
        }
            }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
Before Copying&lt;br&gt;
object1 a value 100&lt;br&gt;
object1 b value 200&lt;br&gt;
object2 a value 100&lt;br&gt;
object2 b value 200&lt;br&gt;
After Copying&lt;br&gt;
object1 a value 1000&lt;br&gt;
object1 b value 2000&lt;br&gt;
object2 a value 1000&lt;br&gt;
object2 b value 2000&lt;/p&gt;

&lt;p&gt;Deep Copy:&lt;br&gt;
A deep copy creates a completely independent copy of an object, including all the objects it refers to. This means the copied object and the original object are fully separate. Changes made to the copied object or its internal parts will not affect the original object, and vice versa.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class DeepCopySupport implements Cloneable {
    int a;
    DeepCopySupport(int a){
    this.a=a;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
      }

public class DeepCopyMain {
    public static void main(String[] args) throws CloneNotSupportedException {
        // TODO Auto-generated method stub
        DeepCopySupport obj1= new DeepCopySupport(90);
        DeepCopySupport obj2= (DeepCopySupport) obj1.clone();
        System.out.println("Before Deep Copy");
        System.out.println("Object1 a value "+obj1.a);
        System.out.println("Object2 a value "+obj2.a);
        obj2.a=100;
        System.out.println("After Deep Copy");
        System.out.println("Object1 a value "+obj1.a);
        System.out.println("Object2 a value "+obj2.a);
      }
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
Before Deep Copy&lt;br&gt;
Object1 a value 90&lt;br&gt;
Object2 a value 90&lt;br&gt;
After Deep Copy&lt;br&gt;
Object1 a value 90&lt;br&gt;
Object2 a value 100&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In real time example:
Shallow Copy:
1. Sharing a calendar with your roommate -&amp;gt; If one updates an event, the other sees it.
2. Lending your notes to a friend -&amp;gt; If they mark/highlight something, it stays.

Deep Copy:
1. Both keeping individual planners -&amp;gt; Each person’s schedule is independent.
2. Both of you take notes separately during class -&amp;gt; Your notes won't reflect their changes.

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Shallow Copy Vs Deep Copy</title>
      <dc:creator>SIVAGANESH L</dc:creator>
      <pubDate>Fri, 13 Jun 2025 09:41:38 +0000</pubDate>
      <link>https://dev.to/pumpkin1996/shallow-copy-vs-deep-copy-1jo9</link>
      <guid>https://dev.to/pumpkin1996/shallow-copy-vs-deep-copy-1jo9</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shallow Copy:&lt;br&gt;
A shallow copy of an object is a copy where only the references to the objects are copied, not the objects themselves. This means that the new object will share the same references to the objects inside the original object. If the internal objects are modified, the changes will be reflected in both the original and the copied objects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ShallowEx {
    int a;
    int b;
    public ShallowEx(){
        this.a =100;
        this.b = 200;
    }
      }

public class ShallowCopyMain {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        ShallowEx obj1 = new ShallowEx();
        System.out.println("Before Copying");
        System.out.println(obj1.a);
        System.out.println(obj1.b);
        //Copying Objects
        ShallowEx obj2= obj1;
        System.out.println(obj2.a);
        System.out.println(obj2.b);
        obj2.a=1000;
        obj2.b=2000;
        System.out.println("After Copying");
        System.out.println("object1value "+obj1.a);
        System.out.println("object1value "+obj1.b);
        System.out.println("object1value "+obj2.a);
        System.out.println("object1value "+obj2.b);
        }
            }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
Before Copying&lt;br&gt;
object1 a value 100&lt;br&gt;
object1 b value 200&lt;br&gt;
object2 a value 100&lt;br&gt;
object2 b value 200&lt;br&gt;
After Copying&lt;br&gt;
object1 a value 1000&lt;br&gt;
object1 b value 2000&lt;br&gt;
object2 a value 1000&lt;br&gt;
object2 b value 2000&lt;/p&gt;

&lt;p&gt;Deep Copy:&lt;br&gt;
A deep copy creates a completely independent copy of an object, including all the objects it refers to. This means the copied object and the original object are fully separate. Changes made to the copied object or its internal parts will not affect the original object, and vice versa.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class DeepCopySupport implements Cloneable {
    int a;
    DeepCopySupport(int a){
    this.a=a;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
      }

public class DeepCopyMain {
    public static void main(String[] args) throws CloneNotSupportedException {
        // TODO Auto-generated method stub
        DeepCopySupport obj1= new DeepCopySupport(90);
        DeepCopySupport obj2= (DeepCopySupport) obj1.clone();
        System.out.println("Before Deep Copy");
        System.out.println("Object1 a value "+obj1.a);
        System.out.println("Object2 a value "+obj2.a);
        obj2.a=100;
        System.out.println("After Deep Copy");
        System.out.println("Object1 a value "+obj1.a);
        System.out.println("Object2 a value "+obj2.a);
      }
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
Before Deep Copy&lt;br&gt;
Object1 a value 90&lt;br&gt;
Object2 a value 90&lt;br&gt;
After Deep Copy&lt;br&gt;
Object1 a value 90&lt;br&gt;
Object2 a value 100&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Basic Git commands for beginners</title>
      <dc:creator>SIVAGANESH L</dc:creator>
      <pubDate>Thu, 05 Jun 2025 04:55:00 +0000</pubDate>
      <link>https://dev.to/pumpkin1996/basic-git-commands-for-beginners-og2</link>
      <guid>https://dev.to/pumpkin1996/basic-git-commands-for-beginners-og2</guid>
      <description>&lt;p&gt;I want to share what i have learnt so for from git. Git is version control system which helps us to track changes in our code and shared among the team members. It's really a great tool.&lt;/p&gt;

&lt;p&gt;Here are some Basic commands that i have learned with simple words.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;git init&lt;br&gt;
It creates a new git repository, .git a hidden file will be created in the project folder and git starts to track everything.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git status&lt;br&gt;
Shows the current state of your files and any time we can see what's going on&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git add&lt;br&gt;
Changes to include in the next commit and can be used before commit changes.&lt;br&gt;
To add specific file:&lt;br&gt;
git add filename.txt&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To add everything:&lt;br&gt;
git add .&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;git commit
command used to saves the changes after you add the your changes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git commit -m "Latest changes in home page"&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;git log
Show the history if commits &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git log&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;git branch
shows all the branches or create a new branch&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;List out the branches:&lt;br&gt;
git branch&lt;/p&gt;

&lt;p&gt;Create a Branch:&lt;br&gt;
git branch newfeature&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;git checkout
Command will switch between branches&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git checkout newfeature&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;git merge
Command will merge or combine one branch to another branch and used when a newfeature is ready and you want add it to the main or master branch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git checkout master&lt;br&gt;
git merge new-feature&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;git clone&lt;br&gt;
Command will copy remote repository to local machine and its used when multiple person work on same project.&lt;br&gt;
git clone &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;https://github.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git push&lt;br&gt;
Command will upload the changes into remote repository and its used after committing the changes locally.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git push origin main&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;git pull
Command will get the latest changes from the remote repository and its used before starting your work  so that you are upto date .&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git pull origin main&lt;/p&gt;

&lt;p&gt;These are the basics git command.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Core Java Data Types – For Beginner's</title>
      <dc:creator>SIVAGANESH L</dc:creator>
      <pubDate>Mon, 02 Jun 2025 06:50:09 +0000</pubDate>
      <link>https://dev.to/pumpkin1996/core-java-data-types-for-beginners-n3g</link>
      <guid>https://dev.to/pumpkin1996/core-java-data-types-for-beginners-n3g</guid>
      <description>&lt;p&gt;When I started learning the Java basics. One of the first things I came across was data types. it’s very important.&lt;/p&gt;

&lt;p&gt;Let me share what I understood so far.&lt;/p&gt;

&lt;p&gt;Data Types:&lt;br&gt;
I simple words, Data types nothing but what kind of data we want to store in a variable.&lt;br&gt;
In real time when we shift our home to another home, we might have different types of boxes where we wanted to store our house hold items and name those boxes accordingly(Ex: Toys, Books, Tools), so java want to know what kind box we are using for numbers, letters etc.&lt;/p&gt;

&lt;p&gt;Java has two main types of data types:&lt;/p&gt;

&lt;p&gt;Primitive Data Types.&lt;br&gt;
Non-Primitive (Reference) Data Types.&lt;/p&gt;

&lt;p&gt;In this post I will give the outline Primitive Data Types.&lt;/p&gt;

&lt;p&gt;There are 8 Primitive Data Types:&lt;br&gt;
| Data Type | Size    | What It Stores            | Example                     |&lt;br&gt;
| --------- | ------- | ------------------------- | --------------------------- |&lt;br&gt;
| &lt;code&gt;byte&lt;/code&gt;    | 1 byte  | Small whole numbers       | &lt;code&gt;byte a = 10;&lt;/code&gt;              |&lt;br&gt;
| &lt;code&gt;short&lt;/code&gt;   | 2 bytes | Bit bigger numbers        | &lt;code&gt;short b = 1000;&lt;/code&gt;           |&lt;br&gt;
| &lt;code&gt;int&lt;/code&gt;     | 4 bytes | Most common whole numbers | &lt;code&gt;int age = 25;&lt;/code&gt;             |&lt;br&gt;
| &lt;code&gt;long&lt;/code&gt;    | 8 bytes | Huge whole numbers        | &lt;code&gt;long stars = 123456789L;&lt;/code&gt;  |&lt;br&gt;
| &lt;code&gt;float&lt;/code&gt;   | 4 bytes | Decimal numbers           | &lt;code&gt;float price = 12.5f;&lt;/code&gt;      |&lt;br&gt;
| &lt;code&gt;double&lt;/code&gt;  | 8 bytes | More accurate decimals    | &lt;code&gt;double pi = 3.14159;&lt;/code&gt;      |&lt;br&gt;
| &lt;code&gt;char&lt;/code&gt;    | 2 bytes | Single character          | &lt;code&gt;char letter = 'A';&lt;/code&gt;        |&lt;br&gt;
| &lt;code&gt;boolean&lt;/code&gt; | 1 bit   | True or False             | &lt;code&gt;boolean isJavaFun = true;&lt;/code&gt; |&lt;/p&gt;

&lt;p&gt;My Personal Suggesion:&lt;br&gt;
First start with int for numbers and double for decimals.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Calculating Bike Mileage in simple Java program</title>
      <dc:creator>SIVAGANESH L</dc:creator>
      <pubDate>Mon, 26 May 2025 05:36:57 +0000</pubDate>
      <link>https://dev.to/pumpkin1996/calculating-bike-mileage-in-simple-java-program-1ohc</link>
      <guid>https://dev.to/pumpkin1996/calculating-bike-mileage-in-simple-java-program-1ohc</guid>
      <description>&lt;p&gt;create a simple Java class called Bike to calculate mileage based on distance traveled and fuel consumed.&lt;/p&gt;

&lt;p&gt;What is Mileage?&lt;br&gt;
Mileage is nothing but how much distance a vehicle is travelled consuming certain amount of fuel. Its calculated as&lt;br&gt;
mileage = distance traveled / fuel used.&lt;br&gt;
EX: 150/5 = 30km/l&lt;/p&gt;

&lt;p&gt;The program has:&lt;br&gt;
A method to get distance travelled&lt;br&gt;
A method to calculate mileage&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public int getDistance(int distance){

    return distance;
}

public int getMileage(int distance, int fuelQuantity) {

    return distance/fuelQuantity;
}

public static void main(String[] args) {
    Bike myBike = new Bike();
    int distance = myBike.getDistance(300);
    int mileage = myBike.getMileage(distance, 5);
    System.out.println("Mileage of this bike:" +mileage);
    }
         }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;getDistance(): This method return the distance value&lt;br&gt;
getMileage(): This method calculate the mileage using the formula &lt;br&gt;
main(): create a Bike object myBike in main method and input the value for distance and fuelQuantity and prints the mileage.&lt;/p&gt;

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