<?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>Forem: Divya bharathi G</title>
    <description>The latest articles on Forem by Divya bharathi G (@divya_bharathig_6635328d).</description>
    <link>https://forem.com/divya_bharathig_6635328d</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%2F3687649%2F08ae24b5-1159-46cb-a416-91d8942b32ea.png</url>
      <title>Forem: Divya bharathi G</title>
      <link>https://forem.com/divya_bharathig_6635328d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/divya_bharathig_6635328d"/>
    <language>en</language>
    <item>
      <title>Constructor in java</title>
      <dc:creator>Divya bharathi G</dc:creator>
      <pubDate>Tue, 10 Feb 2026 15:21:20 +0000</pubDate>
      <link>https://forem.com/divya_bharathig_6635328d/constructor-in-java-199g</link>
      <guid>https://forem.com/divya_bharathig_6635328d/constructor-in-java-199g</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Constructors?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A constructor is a special method in Java that is automatically executed when an object of a class is created. It is mainly used to initialize data members of a class.&lt;/p&gt;

&lt;p&gt;Unlike normal methods, a constructor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It has the same name as the class.&lt;/li&gt;
&lt;li&gt;It does not have a return type.&lt;/li&gt;
&lt;li&gt;It is called automatically using the new keyword.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why do we need Constructors?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Constructors are used because they:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initialize object data at the time of creation.&lt;/li&gt;
&lt;li&gt;Assign default or user-defined values.&lt;/li&gt;
&lt;li&gt;Ensure the object starts in a valid state.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Types of Constructors in Java&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Default Constructor&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A constructor with no parameters is called a default constructor.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Student 
{
    Student() 
    {
        System.out.println("Default constructor called");
    }
}

class Main 
{
    public static void main(String[] args) 
    {
        Student s = new Student();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Parameterized Constructor&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A constructor that accepts parameters is called a parameterized constructor.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Student
 {
    String name;
    int age;

    Student(String name, int age) 
    {
        this.name = name;
        this.age = age;
    }

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Constructor Overloading&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When a class has multiple constructors with different parameters, it is called constructor overloading.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Student 
{
    Student() 
    {
        System.out.println("Default constructor");
    }

    Student(String name) 
    {
        System.out.println("Student name: " + name);
    }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Rules of Constructors in Java&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Constructor name must be the same as the class name.&lt;/li&gt;
&lt;li&gt;Constructors do not have a return type.&lt;/li&gt;
&lt;li&gt;Constructors can be overloaded.&lt;/li&gt;
&lt;li&gt;Constructors cannot be inherited.&lt;/li&gt;
&lt;li&gt;If no constructor is defined, Java provides a default constructor.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;this Keyword in Constructors&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The this keyword refers to the current object of the class. &lt;/li&gt;
&lt;li&gt;It is commonly used when constructor parameters have the same name as instance variables.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Bank
 {
    int accountNo;
    String name;
    int balance;

    Bank(int accountNo, String name, int balance) {
        this.accountNo = accountNo;
        this.name = name;
        this.balance = balance;
    }

    public static void main(String[] args) {
        Bank acc1 = new Bank(101, "Kumar", 1000);
        Bank acc2 = new Bank(102, "Hari", 1500);

        System.out.println(acc1.accountNo);
        System.out.println(acc2.accountNo);
    }
}

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

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Control Flow Statements in Java</title>
      <dc:creator>Divya bharathi G</dc:creator>
      <pubDate>Tue, 20 Jan 2026 14:59:31 +0000</pubDate>
      <link>https://forem.com/divya_bharathig_6635328d/control-flow-statements-in-java-142h</link>
      <guid>https://forem.com/divya_bharathig_6635328d/control-flow-statements-in-java-142h</guid>
      <description>&lt;p&gt;&lt;strong&gt;Control Flow Statements:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Java, control flow statements decide the order in which statements are executed in a program. &lt;/li&gt;
&lt;li&gt;They help your program make decisions, repeat tasks, and jump to different parts of code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Types of control flow statements in java:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Decision making statement.&lt;/li&gt;
&lt;li&gt;Looping statement.&lt;/li&gt;
&lt;li&gt;Jump statement.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;1.Decision making statement.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decision making statement take decision based on the value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;if statement:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if is a java keyword.&lt;/li&gt;
&lt;li&gt;Execute code only if condition is true.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&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;if (condition)
{
    // statements
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Else statement:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;else is a java keyword.&lt;/li&gt;
&lt;li&gt;Execute code only if condition is false.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&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;if (condition)
{
    // statements if true
} 
else 
{
    // statements if false
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Else-if statement:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;else if is a java keyword.&lt;/li&gt;
&lt;li&gt;If we want to check multiple condition,we go for else if statement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&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;if (condition1)
{
    // statements if condition1 is true.
} 
else if (condition2)
{
    // statements if condition2 is true
} 
else
{
    // Statements if none of the condition is true.
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;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;package project1;
public class elseif
{

    public static void main(String[] args) 
    {
        int mark = 60;

        if(mark &amp;gt;= 75)
        {
            System.out.println("Distinction");
        }
        else if(mark &amp;gt;= 60)
        {
            System.out.println("First class");
        }
        else if(mark &amp;gt;= 50)
        {
            System.out.println("Second class");
        }
        else
        {
            System.out.println("Fail");
        }

    }

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Switch statement:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used when there are multiple fixed choices.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;switch (expression)
{
    case value1:
        // statements
        break;
    case value2:
        // statements
        break;
    default:
        // statements
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

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

public class Switch {

    public static void main(String[] args)
    {
        int day = 2;

        switch(day)
        {
        case 1: //1==2
            System.out.println("Monday working day");
            break;

        case 2:
            System.out.println("Tuesday working day");
            break;

        case 3:
            System.out.println("Wednesday working day");
            break;

        case 4:
            System.out.println("Thursday working day");
            break;

        case 5:
            System.out.println("Friday working day");
            break;

        default:
            System.out.println("Holiday");
        }

    }

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2.Looping statement:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Looping statements are used to execute a block of code repeatedly as long as a condition is satisfied.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;While loop:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The while loop executes a block of code as long as the condition is true.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&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;while (condition)
{
    // statements
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;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;public static void main(String[] args)
 {
        int i =1;
        while(i &amp;lt;=10)
        {
            System.out.print(i);
            i++;
        }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The variable i is initialized before the loop starts.&lt;/li&gt;
&lt;li&gt;The condition i &amp;lt;= 10 is checked before each iteration.&lt;/li&gt;
&lt;li&gt;The value of i is incremented inside the loop body, ensuring the loop eventually terminates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;For loop:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It combines initialization, condition checking, and increment/decrement in a single line.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&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;for (initialization; condition; increment/decrement) 
{
    // statements
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;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;for(int i =1;i &amp;lt;=5;i++)
{
System.out.println(i); 
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initialization runs once (int i = 1)&lt;/li&gt;
&lt;li&gt;Condition is checked before every iteration (i &amp;lt;= 5)&lt;/li&gt;
&lt;li&gt;Increment happens after each iteration (i++)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Operators in Java</title>
      <dc:creator>Divya bharathi G</dc:creator>
      <pubDate>Thu, 08 Jan 2026 17:11:46 +0000</pubDate>
      <link>https://forem.com/divya_bharathig_6635328d/operators-in-java-52b4</link>
      <guid>https://forem.com/divya_bharathig_6635328d/operators-in-java-52b4</guid>
      <description>&lt;p&gt;&lt;strong&gt;Opeartors:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Operators are special symbols used to perform operations on variables and values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Operators:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1.Assignment Operators:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used to assign values.
&lt;strong&gt;Eg:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package project1;
public class assignment_operator 
{
    public static void main(String[] args)
    {
        int a=10 , b=2;
        System.out.println(a=b);
    }

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

&lt;/div&gt;


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

&lt;p&gt;&lt;strong&gt;2.Arithmetic Opeartors:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used for mathematical calculations.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Operator   Meaning               Example
2. +         Addition                a + b
3. -         Subtraction         a - b
4. *         Multiplication          a * b
5. /         Division                a / b
6. %         Modulus (remainder)     a % b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Eg:&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;package project1;

public class arrithmetic_operator {

    public static void main(String[] args)
    {
        int a=10 , b=2;
        System.out.println(a+b);
        System.out.println(a-b);
        System.out.println(a*b);
        System.out.println(a/b);
        System.out.println(a%b);
    }

}
&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;12
8
20
5
0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3.Unary Operators&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Operate on single operand.&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   1.++   -&amp;gt; Increment operator
   2.--   -&amp;gt; Decrement operator
   3.no++ --&amp;gt; post increment
   4.++no --&amp;gt; Pre increment
   5.no-- --&amp;gt; post Decrement
   6.--no --&amp;gt; Pre Decrement
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Eg:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package project1;
public class unary_operator 
{
    public static void main(String[] args)
        {
        int i = 10;
        System.out.println(i++);// post Increment operator 10 + 1
        System.out.println(i);//11

        int j = 10;
        System.out.println(j--); //Post Decrement operator 10 -1
        System.out.println(j);

                int a = 10;
        System.out.println(++a);//Pre increment operator 10+1=11

        int b = 20;
        System.out.println(--b); //Pre Decrement operator 20-1=19
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
10&lt;br&gt;
11&lt;br&gt;
10&lt;br&gt;
9&lt;br&gt;
11&lt;br&gt;
19&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.Equality and Relational Operators :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used to compare two values → result is boolean.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Operator Meaning&lt;/li&gt;
&lt;li&gt;==          Equal to&lt;/li&gt;
&lt;li&gt;!=          Not equal&lt;/li&gt;
&lt;li&gt;&amp;gt;           Greater than&lt;/li&gt;
&lt;li&gt;&amp;lt;           Less than&lt;/li&gt;
&lt;li&gt;&amp;gt;=          Greater than or equal&lt;/li&gt;
&lt;li&gt;&amp;lt;=          Less than or equal&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Eg:&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;package project1;
public class relational_operator 
{
    public static void main(String[] args) 
    {
        int tamil_mark = 70;
        int english_mark = 70;
        System.out.println(tamil_mark == english_mark); // boolean
        System.out.println(tamil_mark &amp;lt; english_mark); // Boolean
                System.out.println(tamil_mark &amp;gt; english_mark);
                System.out.println(tamil_mark != english_mark);
    }

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
true&lt;br&gt;
false&lt;br&gt;
false&lt;br&gt;
false&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.Conditional Operators :&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    - Used with boolean values.
          1. &amp;amp;&amp;amp; = AND operator
          2.|| = OR operator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Variable in Java</title>
      <dc:creator>Divya bharathi G</dc:creator>
      <pubDate>Mon, 05 Jan 2026 15:51:09 +0000</pubDate>
      <link>https://forem.com/divya_bharathig_6635328d/variable-in-java-11h9</link>
      <guid>https://forem.com/divya_bharathig_6635328d/variable-in-java-11h9</guid>
      <description>&lt;p&gt;&lt;strong&gt;Variable:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- A variable is the name of a memory location.
- A variable is used to store a value.
- The value of a variable can change during program execution.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Rules for Variable Names in Java&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-  Variable name should start with a lowercase letter.
- Variable name can start with $ or _.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;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;byte tamilMark = 60;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- byte → data type
- tamilMark → variable name
- = → assignment operator
- 60 → value
- ; → end of statement
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Objects and Data types in Java</title>
      <dc:creator>Divya bharathi G</dc:creator>
      <pubDate>Sun, 04 Jan 2026 17:12:32 +0000</pubDate>
      <link>https://forem.com/divya_bharathig_6635328d/objects-and-data-types-in-java-43ip</link>
      <guid>https://forem.com/divya_bharathig_6635328d/objects-and-data-types-in-java-43ip</guid>
      <description>&lt;p&gt;&lt;strong&gt;Object:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An Object is a physical entity meaning that it will physically create a heap memory at runtime.&lt;/li&gt;
&lt;li&gt;An object is a combination of state (data/variables-Color, RAM) and behavior(methods /functions-Call, SMS).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&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;Classname referenceName = new Classname();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;new is a Java keyword.&lt;/li&gt;
&lt;li&gt;If we mention a new keyword in object,JVM will allcated one memory in heap at runtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Types:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data types specify what type of data a variable can store.&lt;/li&gt;
&lt;li&gt;Java has two main types of data types:

&lt;ul&gt;
&lt;li&gt;Primitive data types.&lt;/li&gt;
&lt;li&gt;Non-primitive data types.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Primitive data type:&lt;/strong&gt;&lt;br&gt;
       -Primitive data types store simple values.&lt;br&gt;
       -Memory management of primitive data type is stack.&lt;br&gt;
       -There are 8 primitive data types in java.&lt;br&gt;
             1.short&lt;br&gt;
             2.byte&lt;br&gt;
             3.int&lt;br&gt;
             4.long&lt;br&gt;
             5.float&lt;br&gt;
             6.double&lt;br&gt;
             7.char&lt;br&gt;
             8.boolean&lt;br&gt;
       -These 8 primitive data types are known as Keywords.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Non-Primitive Data Type:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-String is a Non-primitive data type.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Size and Range of data types:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Size of all primitive data types:&lt;br&gt;
       1.short = 2 byte.&lt;br&gt;
       2.byte = 1 byte.&lt;br&gt;
       3.int = 4 byte.&lt;br&gt;
       4.long = 8 byte.&lt;br&gt;
       5.float = 4 byte.&lt;br&gt;
       6.double = 8 byte.&lt;br&gt;
       7.char = 2 byte.&lt;br&gt;
       8.boolean = 1 bit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To calulate range:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   -1 byte = 8 bit = 2*2*2*2*2*2*2*2.
                   = 256 (so 256/2=128)
   - To store the negative value the range starts from -128 to 127(The range ends at 127 because 0 i included).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; -short = -32,768 to +32,767.
 -byte = -128 to 127.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>beginners</category>
      <category>java</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Class in Java</title>
      <dc:creator>Divya bharathi G</dc:creator>
      <pubDate>Sun, 04 Jan 2026 06:51:04 +0000</pubDate>
      <link>https://forem.com/divya_bharathig_6635328d/class-in-java-459</link>
      <guid>https://forem.com/divya_bharathig_6635328d/class-in-java-459</guid>
      <description>&lt;p&gt;&lt;strong&gt;Class:&lt;/strong&gt;&lt;br&gt;
     -&amp;gt;A class is a blueprint or template used to create objects.&lt;br&gt;
     -&amp;gt;Class is a Java keyword.&lt;br&gt;
     -&amp;gt;A class does not occupy memory until an object is created.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax for class:&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;class Classname
{

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Rules for Classname:&lt;/strong&gt;&lt;br&gt;
     -&amp;gt;The first letter of Classname should be in capital.&lt;br&gt;
     -&amp;gt;Classname should allow special characters like $ and _ .&lt;br&gt;
     -&amp;gt; $ and _ can be used at the beginning, middle, or end of a class name, but no other special characters are allowed.&lt;br&gt;
     -&amp;gt;Classname should allow numeric values that can be used in the middle or at the end of a class name.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>2nd Level Translator(JRE,JVM,JIT)</title>
      <dc:creator>Divya bharathi G</dc:creator>
      <pubDate>Sat, 03 Jan 2026 12:16:01 +0000</pubDate>
      <link>https://forem.com/divya_bharathig_6635328d/2nd-level-translatorjrejvmjit-1odc</link>
      <guid>https://forem.com/divya_bharathig_6635328d/2nd-level-translatorjrejvmjit-1odc</guid>
      <description>&lt;p&gt;&lt;strong&gt;1.JRE(Java Runtime Environment)&lt;/strong&gt;&lt;br&gt;
    -&amp;gt;JRE(Java Runtime Environment) provides an environment to run Java &lt;br&gt;
      programs.&lt;br&gt;
    -&amp;gt;It contains the JVM and standard class libraries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.JVM(Java Virtual Machine)&lt;/strong&gt;&lt;br&gt;
    -&amp;gt; JVM(Java Virtual Machine) performs memory management operation.&lt;br&gt;
    -&amp;gt; It is responsible for converting bytecode into machine-specific&lt;br&gt;
       instructions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.JIT(Just intime Compiler)&lt;/strong&gt;&lt;br&gt;
    -&amp;gt; It is a component of the JVM that improves the performance of Java &lt;br&gt;
       programs.&lt;br&gt;
    -&amp;gt; It converts bytecode into native machine code at runtime.&lt;br&gt;
    -&amp;gt; It compiles only the frequently executed code.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Introduction to Java</title>
      <dc:creator>Divya bharathi G</dc:creator>
      <pubDate>Fri, 02 Jan 2026 12:48:14 +0000</pubDate>
      <link>https://forem.com/divya_bharathig_6635328d/introduction-to-java-e7n</link>
      <guid>https://forem.com/divya_bharathig_6635328d/introduction-to-java-e7n</guid>
      <description>&lt;p&gt;Computers only understand binary language (1s and 0s), but humans write&lt;br&gt;&lt;br&gt;
programs in high-level languages like Java.  &lt;/p&gt;

&lt;p&gt;1.How does Java code written by humans get executed by machines?&lt;br&gt;
   It uses Translation system(JDK → JRE → JVM → JIT) to convert Programming language to Machine Language.&lt;/p&gt;

&lt;p&gt;2.What is JDK?&lt;br&gt;
    -&amp;gt; JDK is Known as Java Development Kit.&lt;br&gt;
    -&amp;gt; We should save the java file as .java (Eg:Sample.java).&lt;br&gt;
    -&amp;gt; If there is no error in the .java file then it convert .java file into .class file (Eg:Sample.java will be converted into Sample.class file)&lt;br&gt;
    -&amp;gt; Where .java file is a readable file and .class is a unreadable file.&lt;br&gt;
    -&amp;gt;If there is a error it will shown specifically like line 3.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
