<?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: SATHISH BALAJI</title>
    <description>The latest articles on DEV Community by SATHISH BALAJI (@sathish_balaji_2003).</description>
    <link>https://dev.to/sathish_balaji_2003</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%2F2594207%2F134f72bd-790f-4fa5-a9fe-402fa302b2a0.jpg</url>
      <title>DEV Community: SATHISH BALAJI</title>
      <link>https://dev.to/sathish_balaji_2003</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sathish_balaji_2003"/>
    <language>en</language>
    <item>
      <title>React DOM</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Fri, 13 Jun 2025 10:21:10 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/react-dom-78p</link>
      <guid>https://dev.to/sathish_balaji_2003/react-dom-78p</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. Library vs Framework?&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%2Fqiq0c4k89ob1mvl1vpnu.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%2Fqiq0c4k89ob1mvl1vpnu.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. What is React DOM?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ReactDom is a core react package that provides methods to interact with the Document Object Model or DOM. This package allows developers to access and modify the DOM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. NPM vs NPX?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NPM&lt;/strong&gt;: It is a package manager, you can install node.js packages using NPM&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NPX&lt;/strong&gt;: It is a tool to execute node.js packages.&lt;/p&gt;

&lt;p&gt;It doesn't matter whether you installed that package globally or locally. NPX will temporarily install it and run it. NPM also can run packages if you configure a package.json file and include it in the script section. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. SPA vs MPA?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SPA&lt;/strong&gt;: Single-Page application refers to a type of application that entirely runs within the web browser and does not require the entire page to be reloaded during use. The goal is faster transitions that make the website feel more like a native mobile app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MPA&lt;/strong&gt;: Multi-Page application is a web application that loads a new page for each action that the user takes. A multi-page app consists of multiple static pages that load a new page for the server and then update the content of that page as needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. JS vs JSX?&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%2Fhd8lzhph6i5qdtbfnqqq.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%2Fhd8lzhph6i5qdtbfnqqq.png" alt="Image description" width="800" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/reactjs/reactjs-reactdom/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/reactjs/reactjs-reactdom/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://stackoverflow.com/questions/50605219/difference-between-npx-and-npm" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/50605219/difference-between-npx-and-npm&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.spaceotechnologies.com/blog/single-page-application-vs-multi-page-application/" rel="noopener noreferrer"&gt;https://www.spaceotechnologies.com/blog/single-page-application-vs-multi-page-application/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/reactjs/what-is-the-difference-between-a-js-and-jsx-file-in-react/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/reactjs/what-is-the-difference-between-a-js-and-jsx-file-in-react/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/software-engineering/software-framework-vs-library/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/software-engineering/software-framework-vs-library/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>Scanner</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Thu, 20 Feb 2025 08:59:11 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/scanner-1652</link>
      <guid>https://dev.to/sathish_balaji_2003/scanner-1652</guid>
      <description>&lt;p&gt;The Scanner class is used to get user input, and it is found in the java.util package.&lt;/p&gt;

&lt;p&gt;To use the Scanner class, create an object of the class and use any of the available methods found in the Scanner class documentation. &lt;br&gt;
In our example, we will use the nextLine() method, which is used to read Strings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.Scanner;  // Import the Scanner class

class Main {
  public static void main(String[] args) {
    Scanner myObj = new Scanner(System.in);  // Create a Scanner object
    System.out.println("Enter username");

    String userName = myObj.nextLine();  // Read user input
    System.out.println("Username is: " + userName);  // Output user input
  }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Input Types&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%2Fuf4xd4d3cuvkbg59d3zt.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%2Fuf4xd4d3cuvkbg59d3zt.png" alt="Image description" width="587" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/java/java_user_input.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/java/java_user_input.asp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>linux</category>
      <category>beginners</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>While Loop</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Wed, 29 Jan 2025 16:27:53 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/while-loop-2fe4</link>
      <guid>https://dev.to/sathish_balaji_2003/while-loop-2fe4</guid>
      <description>&lt;p&gt;&lt;strong&gt;Java while loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The while loop is also used to iterate over the number of statements multiple times. However, if we don't know the number of iterations in advance, it is recommended to use a while loop. Unlike for loop, the initialization and increment/decrement doesn't take place inside the loop statement in while loop.&lt;/p&gt;

&lt;p&gt;It is also known as the entry-controlled loop since the condition is checked at the start of the loop. If the condition is true, then the loop body will be executed; otherwise, the statements after the loop will be executed.&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%2Fk43oglyxjbl1umbtqtwv.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%2Fk43oglyxjbl1umbtqtwv.png" alt="Image description" width="351" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calculation .java&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;    public class Calculation {    
    public static void main(String[] args) {    
    // TODO Auto-generated method stub    
    int i = 0;    
    System.out.println("Printing the list of first 10 even numbers \n");    
    while(i&amp;lt;=10) {    
    System.out.println(i);    
    i = i + 2;    
    }    
    }    
    }    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&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;Printing the list of first 10 even numbers 

0
2
4
6
8
10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>java</category>
      <category>developer</category>
      <category>linux</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>System.out.println()</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Tue, 07 Jan 2025 15:05:12 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/systemoutprintln-33o3</link>
      <guid>https://dev.to/sathish_balaji_2003/systemoutprintln-33o3</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is System.out.println&lt;/strong&gt;&lt;br&gt;
System.out.println is a Java statement that prints the argument passed, into the System.out which is generally stdout.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;System&lt;/strong&gt; – is a final class in java.lang package. As per javadoc, “…Among the facilities provided by the System class are standard input, standard output, and error output streams.[TBD]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;out&lt;/strong&gt; – is a static member field of System class and is of type PrintStream.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;println&lt;/strong&gt; – is a method of PrintStream class. println prints the argument passed to the standard console and a newline. There are multiple println methods with different arguments (overloading). Every println makes a call to print method and adds a newline. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://javapapers.com/core-java/system-out-println/" rel="noopener noreferrer"&gt;https://javapapers.com/core-java/system-out-println/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>linux</category>
      <category>fullstack</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>Constructor</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Sun, 05 Jan 2025 12:31:26 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/constructor-5f5o</link>
      <guid>https://dev.to/sathish_balaji_2003/constructor-5f5o</guid>
      <description>&lt;p&gt;&lt;strong&gt;1) What is a Constructor?&lt;/strong&gt;&lt;br&gt;
---&amp;gt; In Java, a constructor is a block of codes similar to the method. It is called when an instance of the class is created. At the time of calling constructor, memory for the object is allocated in the memory.&lt;br&gt;
---&amp;gt; It is a special type of method which is used to initialize the object.&lt;br&gt;
---&amp;gt; Every time an object is created using the new keyword, at least one constructor is called.&lt;br&gt;
---&amp;gt; It calls a default constructor if there is no constructor available in the class. In such case, Java compiler provides a default constructor by default.&lt;/p&gt;

&lt;p&gt;There are following rules for defining a constructor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Constructor name must be the same as its class name.&lt;/li&gt;
&lt;li&gt;A Constructor must have no explicit return type.&lt;/li&gt;
&lt;li&gt;A Java constructor cannot be abstract, static, final, and synchronized.[TBD]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2) Types of Constructors&lt;/strong&gt;&lt;br&gt;
 There are three types of constructors in Java:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Default Constructor&lt;/li&gt;
&lt;li&gt;Parameterized Constructor&lt;/li&gt;
&lt;li&gt;Copy Constructor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;1. Default Constructor in Java &lt;/u&gt; &lt;/p&gt;

&lt;p&gt;A constructor that has no parameters is known as default constructor. A default constructor is invisible. And if we write a constructor with no arguments, the compiler does not create a default constructor. It is taken out. It is being overloaded and called a parameterized constructor. The default constructor changed into the parameterized constructor. But Parameterized constructor can’t change the default constructor. The default constructor can be implicit or explicit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implicit Default Constructor:&lt;/strong&gt; If no constructor is defined in a class, the Java compiler automatically provides a default constructor. This constructor doesn’t take any parameters and initializes the object with default values, such as 0 for numbers, null for objects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explicit Default Constructor:&lt;/strong&gt; If we define a constructor that takes no parameters, it’s called an explicit default constructor. This constructor replaces the one the compiler would normally create automatically. Once you define any constructor (with or without parameters), the compiler no longer provides the default constructor for you.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;2. Parameterized Constructor in Java&lt;/u&gt;&lt;br&gt;
A constructor that has parameters is known as parameterized constructor. If we want to initialize fields of the class with our own values, then use a parameterized constructor.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;3. Copy Constructor in Java&lt;/u&gt; [TBD]&lt;br&gt;
Unlike other constructors copy constructor is passed with another object which copies the data available from the passed object to the newly created object. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3) What is Constructor Overloading?&lt;/strong&gt;&lt;br&gt;
The constructor overloading can be defined as the concept of having more than one constructor with different parameters so that every constructor can perform a different task.&lt;br&gt;
Java supports Constructor Overloading in addition to overloading methods. In Java, overloaded constructor is called based on the parameters specified when a new is executed. Sometimes there is a need of initializing an object in different ways. This can be done using constructor overloading.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4) What is the use of "this" keyword?&lt;/strong&gt;&lt;br&gt;
The "this" keyword refers to the current object in a method or constructor.&lt;/p&gt;

&lt;p&gt;The most common use of the "this" keyword is to eliminate the confusion between class attributes and parameters with the same name (because a class attribute is shadowed by a method or constructor parameter).&lt;/p&gt;

&lt;p&gt;"this" can also be used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Invoke current class constructor&lt;/li&gt;
&lt;li&gt;Invoke current class method&lt;/li&gt;
&lt;li&gt;Return the current class object&lt;/li&gt;
&lt;li&gt;Pass an argument in the method call&lt;/li&gt;
&lt;li&gt;Pass an argument in the constructor call&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.javatpoint.com/java-constructor" rel="noopener noreferrer"&gt;https://www.javatpoint.com/java-constructor&lt;/a&gt;&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;br&gt;
&lt;a href="https://www.javatpoint.com/constructor-overloading-in-java" rel="noopener noreferrer"&gt;https://www.javatpoint.com/constructor-overloading-in-java&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/constructor-overloading-java/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/constructor-overloading-java/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/java/ref_keyword_this.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/java/ref_keyword_this.asp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>linux</category>
      <category>fullstack</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>Tasks</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Sat, 28 Dec 2024 17:01:35 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/tasks-3p15</link>
      <guid>https://dev.to/sathish_balaji_2003/tasks-3p15</guid>
      <description>&lt;p&gt;&lt;strong&gt;Task 1&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a class called 'Jewellery'&lt;/li&gt;
&lt;li&gt;Create below static variables: 
static int goldPrice = 7100; 
static int silverPrice = 150; 
2.1. Create below non-static variables
int making_charges, wastage; &lt;/li&gt;
&lt;li&gt;Create main method. &lt;/li&gt;
&lt;li&gt;Inside main method, create instance as below
Jewellery jewel1 = new Jewellery(); 
Jewellery jewel2 = new Jewellery(); &lt;/li&gt;
&lt;li&gt;Using jewel1, assign making_charges and wastage. &lt;/li&gt;
&lt;li&gt;Using jewel2, assign making_charges and wastage. &lt;/li&gt;
&lt;li&gt;Call a non-static method as below. 
jewel1.bill(); 
jewel2.bill(); &lt;/li&gt;
&lt;li&gt;Save, Compile and fix the error. &lt;/li&gt;
&lt;li&gt;Inside bill() method, print making_charges and wastage.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Jewellery
{
static int goldPrice = 7100; 
static int silverPrice = 150;
int making_charge;
int wastage;
public static void main (String[] args)
{
Jewellery jewel1 = new Jewellery(); 
Jewellery jewel2 = new Jewellery(); 
jewel1.making_charge = 2000;
jewel1.wastage = 1000;
jewel2.making_charge = 1000;
jewel2.wastage = 500;
jewel1.bill1();
jewel2.bill2(); 
} 
public void bill1()
{
System.out.println("Jewel 1 Bill: "+"\n"+"Gold Price = " +goldPrice+"\n"+"Making Charge = " +making_charge+"\n"+"Wastage = " +wastage+"\n"+"Total = " +(goldPrice+making_charge+wastage));
}
public void bill2()
{
System.out.println("Jewel 2 Bill: "+"\n"+"Silver Price = " +silverPrice+"\n"+"Making Charge = " +making_charge+"\n"+"Wastage = " +wastage+"\n"+"Total = " +(silverPrice+making_charge+wastage));
}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&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;Jewel 1 Bill: 
Gold Price = 7100
Making Charge = 2000
Wastage = 1000
Total = 10100
Jewel 2 Bill: 
Silver Price = 150
Making Charge = 1000
Wastage = 500
Total = 1650

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Task 2&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a class called 'Shop'&lt;/li&gt;
&lt;li&gt;Create below static variables: 
static int doorNo = 5; 
static int discount = 10; 
2.1. Create below non-static variables
int price, weight; &lt;/li&gt;
&lt;li&gt;Create main method. &lt;/li&gt;
&lt;li&gt;Inside main method, create instance as below
Shop product1 = new Shop(); 
Shop product2 = new Shop();
&lt;/li&gt;
&lt;li&gt;Using product1, assign price and weight. &lt;/li&gt;
&lt;li&gt;Using product2, assign price and weight. &lt;/li&gt;
&lt;li&gt;Call a non-static method as below. 
product1.bill(); 
product2.bill(); &lt;/li&gt;
&lt;li&gt;Save, Compile and fix the error. &lt;/li&gt;
&lt;li&gt;Inside bill() method, print price and weight. &lt;/li&gt;
&lt;li&gt;Inside main method and inside bill() method, print doorNo and discount
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Shop
{
static int doorNo = 5; 
static int discount = 10;
int price;
int weight;
public static void main (String[] args)
{
Shop product1 = new Shop();
Shop product2 = new Shop();
product1.price = 1000;
product2.price = 2000;
product1.weight = 10;
product2.weight = 20;
System.out.println("Door No: "+doorNo);
System.out.println("Discount: "+discount);
product1.bill1();
product2.bill2();
} 
public void bill1()
{
System.out.println("Product 1"+"\n"+"Price = "+price+"\n"+"Weight = "+weight);
}
public void bill2()
{
System.out.println("Product 2"+"\n"+"Price = "+price+"\n"+"Weight = "+weight);
}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&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;Door No: 5
Discount: 10
Product 1
Price = 1000
Weight = 10
Product 2
Price = 2000
Weight = 20

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Variables</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Sat, 28 Dec 2024 16:55:55 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/variables-n38</link>
      <guid>https://dev.to/sathish_balaji_2003/variables-n38</guid>
      <description>&lt;p&gt;Variables are the containers for storing the data values or you can also call it a memory location name for the data. Every variable has a:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Type – The kind of data that it can hold. For example, int, string, float, char, etc.
&lt;/li&gt;
&lt;li&gt;Variable Name – To identify the variable uniquely within the scope.&lt;/li&gt;
&lt;li&gt;Value – The data assigned to the variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Types of Java Variables&lt;/strong&gt;&lt;br&gt;
There are three types of variables in Java. They are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Local Variables&lt;/li&gt;
&lt;li&gt;Instance Variables&lt;/li&gt;
&lt;li&gt;Static Variables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. Local Variables&lt;/strong&gt;&lt;br&gt;
A variable defined within a block or method or constructor is called a local variable. &lt;br&gt;
i) The Local variable is created at the time of declaration and destroyed after exiting from the block or when the call returns from the function.&lt;br&gt;
ii) The scope of these variables exists only within the block in which the variables are declared, i.e., we can access these variables only within that block.&lt;br&gt;
iii) Initialization of the local variable is mandatory before using it in the defined scope. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Instance Variables (Non-Static)&lt;/strong&gt;&lt;br&gt;
Instance variables are non-static variables and are declared in a class outside of any method, constructor, or block. &lt;/p&gt;

&lt;p&gt;i) As instance variables are declared in a class, these variables are created when an object of the class is created and destroyed when the object is destroyed.&lt;br&gt;
ii) Unlike local variables, we may use access specifiers for instance variables. If we do not specify any access specifier, then the default access specifier will be used.&lt;br&gt;
iii) Initialization of an instance variable is not mandatory. Its default value is dependent on the data type of variable. For String it is null, for float it is 0.0f, for int it is 0, for Wrapper classes like Integer it is null, etc.&lt;br&gt;
iv) Instance variables can be accessed only by creating objects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Static Variables&lt;/strong&gt;&lt;br&gt;
Static variables are also known as class variables. &lt;/p&gt;

&lt;p&gt;i) These variables are declared similarly to instance variables. The difference is that static variables are declared using the static keyword within a class outside of any method, constructor, or block.&lt;br&gt;
ii) Unlike instance variables, we can only have one copy of a static variable per class, irrespective of how many objects we create.&lt;br&gt;
iii) Static variables are created at the start of program execution and destroyed automatically when execution ends.&lt;br&gt;
iv) Static variables cannot be declared locally inside an instance method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href="https://www.geeksforgeeks.org/variables-in-java/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/variables-in-java/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>linux</category>
      <category>fullstack</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>Datatypes</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Fri, 27 Dec 2024 12:46:20 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/datatypes-27p</link>
      <guid>https://dev.to/sathish_balaji_2003/datatypes-27p</guid>
      <description>&lt;p&gt;Java is statically typed and also a strongly typed language because, in Java, each type of data (such as integer, character, hexadecimal, packed decimal, and so forth) is predefined as part of the programming language and all constants or variables defined for a given program must be described with one of the Java data types. Data types in Java are of different sizes and values that can be stored in the variable that is made as per convenience and circumstances to cover up all test cases. &lt;/p&gt;

&lt;p&gt;Java has two categories in which data types are segregated: &lt;br&gt;
&lt;strong&gt;1. Primitive Data Types in Java&lt;/strong&gt;&lt;br&gt;
Primitive data are only single values and have no special capabilities.  There are 8 primitive data types.&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%2Fkrpcxy8ocyosm60ts3f6.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%2Fkrpcxy8ocyosm60ts3f6.png" alt="Image description" width="542" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Non-Primitive (Reference) Data Types&lt;/strong&gt;&lt;br&gt;
The Non-Primitive (Reference) Data Types will contain a memory address of variable values because the reference types won’t store the variable value directly in memory. They are strings, objects, arrays, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;i) Strings&lt;/strong&gt;[TBD]&lt;br&gt;
Strings are defined as an array of characters. The difference between a character array and a string in Java is, that the string is designed to hold a sequence of characters in a single variable whereas, a character array is a collection of separate char-type entities. Unlike C/C++, Java strings are not terminated with a null character.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ii) Class&lt;/strong&gt;&lt;br&gt;
A Class is a user-defined blueprint or prototype from which objects are created.  It represents the set of properties or methods that are common to all objects of one type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iii) Object&lt;/strong&gt;&lt;br&gt;
An Object is a basic unit of Object-Oriented Programming and represents real-life entities.  A typical Java program creates many objects, which as you know, interact by invoking methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iv) Interface&lt;/strong&gt;[TBD]&lt;br&gt;
Like a class, an interface can have methods and variables, but the methods declared in an interface are by default abstract (only method signature, no body).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;v) Array&lt;/strong&gt;[TBD]&lt;br&gt;
An Array is a group of like-typed variables that are referred to by a common name. Arrays in Java work differently than they do in C/C++.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt; &lt;a href="https://www.geeksforgeeks.org/data-types-in-java/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/data-types-in-java/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>linux</category>
      <category>learning</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>Objects</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Fri, 27 Dec 2024 12:28:54 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/objects-3jb</link>
      <guid>https://dev.to/sathish_balaji_2003/objects-3jb</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. Object&lt;/strong&gt;&lt;br&gt;
          An object in Java is a basic unit of Object-Oriented Programming and represents real-life entities. Objects are the instances of a class that are created to use the attributes and methods of a class.  A typical Java program creates many objects, which as you know, interact by invoking methods. An object consists of :&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;i) State :&lt;/strong&gt; It is represented by attributes of an object. It also reflects the properties of an object.&lt;br&gt;
Eg: what the objects have, Student have a first name, last name, age, etc.&lt;br&gt;
&lt;strong&gt;ii) Behavior :&lt;/strong&gt; It is represented by the methods of an object. It also reflects the response of an object with other objects.&lt;br&gt;
Eg:  what the objects do, Student attend a course "Java for beginners". &lt;br&gt;
&lt;strong&gt;iii) Identity :&lt;/strong&gt; It gives a unique name to an object and enables one object to interact with other objects.&lt;br&gt;
Eg: what makes them unique, Student have Student-ID-number, or an email which is unique.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. State&lt;/strong&gt;&lt;br&gt;
          State is basically of two types:&lt;br&gt;
          i) Statically Typed Programming Language&lt;br&gt;
          ii) Dynamically Typed Programming Language&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Statically Typed Programming Language&lt;/strong&gt;&lt;br&gt;
In statically typed programming languages, type checking occurs at compile time. At compile time, source code in a specific programming language is converted to a machine-readable format. This means that before source code is compiled, the type associated with each and every single variable must be known. Some common examples of programming languages that belong to this category are Java, Haskell, C, C++, C#, Scala, Kotlin, Fortran, Go, Pascal, and Swift.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Dynamically Typed Programming Language&lt;/strong&gt;&lt;br&gt;
In dynamically typed languages, type checking takes place at runtime or execution time. This means that variables are checked against types only when the program is executing. Some examples of programming languages that belong to this category are Python, JavaScript, Lisp, PHP, Ruby, Perl, Lua, and Tcl.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/classes-objects-java/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/classes-objects-java/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.baeldung.com/cs/statically-vs-dynamically-typed-languages" rel="noopener noreferrer"&gt;https://www.baeldung.com/cs/statically-vs-dynamically-typed-languages&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>java</category>
      <category>learning</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>Create Class and Object</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Thu, 26 Dec 2024 14:49:38 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/create-class-and-object-4599</link>
      <guid>https://dev.to/sathish_balaji_2003/create-class-and-object-4599</guid>
      <description>&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%2F9cggg47fpupj4xl2vqpp.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%2F9cggg47fpupj4xl2vqpp.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. How Object is created in Java?&lt;/strong&gt;&lt;br&gt;
          The object is a basic building block of an OOPs language. In Java, we cannot execute any program without creating an object. &lt;br&gt;
Java provides five ways to create an object.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; -Using new Keyword
 -Using clone() method
 -Using newInstance() method of the Class class
 -Using newInstance() method of the Constructor class
 -Using Deserialization
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;i) Using new Keyword&lt;/strong&gt;&lt;br&gt;
          Using the new keyword is the most popular way to create an object or instance of the class. When we create an instance of the class by using the new keyword, it allocates memory (heap) for the newly created object and also returns the reference of that object to that memory. The new keyword is also used to create an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ii) Using clone() Method&lt;/strong&gt;[TBD]&lt;br&gt;
          The clone() method is the method of Object class. It creates a copy of an object and returns the same copy. The JVM creates a new object when the clone() method is invoked. It copies all the content of the previously created object into new one object. Note that it does not call any constructor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iii) Using newInstance() Method of Class class&lt;/strong&gt;[TBD]&lt;br&gt;
          The newInstance() method of the Class class is also used to create an object. It calls the default constructor to create the object. It returns a newly created instance of the class represented by the object. It internally uses the newInstance() method of the Constructor class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iv) Using newInstance() Method of Constructor class&lt;/strong&gt;[TBD]&lt;br&gt;
          t is similar to the newInstance() method of the Class class. It is known as a reflective way to create objects. The method is defined in the Constructor class which is the class of java.lang.reflect package. We can also call the parameterized constructor and private constructor by using the newInstance() method. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;v) Using Deserialization&lt;/strong&gt;[TBD]&lt;br&gt;
          In Java, serialization is the process of converting an object into a sequence of byte-stream. The reverse process (byte-stream to object) of serialization is called deserialization. The JVM creates a new object when we serialize or deserialize an object. It does not use constructor to create an object. While using deserialization, the Serializable interface (marker interface) must be implemented in the class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt; &lt;a href="https://www.javatpoint.com/how-to-create-object-in-java" rel="noopener noreferrer"&gt;https://www.javatpoint.com/how-to-create-object-in-java&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. How method is called in Java?&lt;/strong&gt;&lt;br&gt;
          In Java, a method is a block of code that performs a specific function and runs only when it is called. Methods are also commonly known as functions. Each method has its name. You can pass data into a method via parameters. A method also has a return type defining the type of data it returns. According to the convention, the name of the method should be written in lowerCamelCase where the first letter should be small. Furthermore, a method should have a proper name, preferably a verb referring to what it does.&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%2Ftvzbwftas6zxvkfctbe6.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%2Ftvzbwftas6zxvkfctbe6.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt;&lt;a href="https://codegym.cc/groups/posts/how-to-call-a-method-in-java-" rel="noopener noreferrer"&gt;https://codegym.cc/groups/posts/how-to-call-a-method-in-java-&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. How method is defined in Java?&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%2Fnhup9dkrcdwjl4y1t5x7.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%2Fnhup9dkrcdwjl4y1t5x7.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>linux</category>
      <category>basic</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>Day - 1 of Java</title>
      <dc:creator>SATHISH BALAJI</dc:creator>
      <pubDate>Mon, 23 Dec 2024 16:51:53 +0000</pubDate>
      <link>https://dev.to/sathish_balaji_2003/day-1-of-java-4ecp</link>
      <guid>https://dev.to/sathish_balaji_2003/day-1-of-java-4ecp</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What is sudo?&lt;/strong&gt;&lt;br&gt;
      Sudo (Super User do) is a linux command that is used to temporarily execute programs as another user. It is the same as what we use in windows "run as administrator".&lt;br&gt;
Reference: &lt;a href="https://documentation.suse.com/smart/systems-management/html/sudo-run-commands-as-superuser/index.html" rel="noopener noreferrer"&gt;https://documentation.suse.com/smart/systems-management/html/sudo-run-commands-as-superuser/index.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What is APT?&lt;/strong&gt;&lt;br&gt;
      APT (Advanced Package Tool) is a collection of tools used to install, update, remove, and manage software packages on Debian and its derivative operating systems, including Ubuntu and Linux Mint.&lt;br&gt;
Reference: &lt;a href="https://www.digitalocean.com/community/tutorials/what-is-apt" rel="noopener noreferrer"&gt;https://www.digitalocean.com/community/tutorials/what-is-apt&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What is JDK?&lt;/strong&gt;&lt;br&gt;
      JDK (Java Development Kit) is a distribution of Java technology by Oracle Corporation. It is derivative of the community driven OpenJDK which Oracle stewards. It provides software for working with Java applications.&lt;br&gt;
Reference: &lt;a href="https://en.wikipedia.org/wiki/Java_Development_Kit" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Java_Development_Kit&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What happens behind the screen, after we enter Java C?&lt;/strong&gt;&lt;br&gt;
      The "javac" command reads human-readable code (source files) that contain module, package and type declarations written in the Java programming language, and compiles them into bytecode (class files) that run on the Java Virtual Machine. &lt;br&gt;
Reference: &lt;a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html&lt;/a&gt;         &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>java</category>
      <category>linux</category>
      <category>payilagam</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
