<?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: Haryniramesh</title>
    <description>The latest articles on DEV Community by Haryniramesh (@haryniramesh_90cfe77bda94).</description>
    <link>https://dev.to/haryniramesh_90cfe77bda94</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%2F2903020%2Fb285689a-c8e0-4a0b-bf31-3b9f13299f17.jpg</url>
      <title>DEV Community: Haryniramesh</title>
      <link>https://dev.to/haryniramesh_90cfe77bda94</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/haryniramesh_90cfe77bda94"/>
    <language>en</language>
    <item>
      <title>Template Literals</title>
      <dc:creator>Haryniramesh</dc:creator>
      <pubDate>Thu, 29 May 2025 17:20:23 +0000</pubDate>
      <link>https://dev.to/haryniramesh_90cfe77bda94/template-literals-5flk</link>
      <guid>https://dev.to/haryniramesh_90cfe77bda94/template-literals-5flk</guid>
      <description>&lt;p&gt;&lt;strong&gt;Types of Literals in JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. String Literals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const name1 = 'Alice';&lt;br&gt;
const name2 = "Bob";&lt;br&gt;
const greeting = &lt;code&gt;Hello&lt;/code&gt;;  // Template literal&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Numeric Literals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const age = 25;        // Integer&lt;br&gt;
const pi = 3.14;       // Floating point&lt;br&gt;
const hex = 0xFF;      // Hexadecimal (255)&lt;br&gt;
const binary = 0b1010; // Binary (10)&lt;br&gt;
const octal = 0o12;    // Octal (10)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Boolean Literals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const isTrue = true;&lt;br&gt;
const isFalse = false;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Array Literals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const fruits = ['apple', 'banana', 'cherry'];&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Object Literals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const person = {&lt;br&gt;
  name: 'John',&lt;br&gt;
  age: 30&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Null Literal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const empty = null;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Undefined Literal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;undefined is usually a value assigned by JavaScript when a variable is declared but not initialized.&lt;/p&gt;

&lt;p&gt;let x;&lt;br&gt;
console.log(x); // undefined&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Regular Expression Literal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const pattern = /ab+c/;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Template Literals (Special type of string literal)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const user = 'Jane';&lt;br&gt;
const message = &lt;code&gt;Hello, ${user}!&lt;/code&gt;; // String + Expression&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ 1. Template Literals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Used to embed variables and expressions in strings.&lt;/p&gt;

&lt;p&gt;const name = "Alice";&lt;br&gt;
const age = 25;&lt;br&gt;
const message = &lt;code&gt;My name is ${name} and I am ${age} years old.&lt;/code&gt;;&lt;br&gt;
console.log(message);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ 2. HTML  Element (for DOM templates)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In web development, the  HTML element holds HTML that you can clone and insert into the DOM using JavaScript.&lt;/p&gt;


&lt;h2&gt;&lt;/h2&gt;
&lt;br&gt;
    
&lt;br&gt;
  &lt;br&gt;


&lt;p&gt;const template = document.getElementById("card-template");&lt;br&gt;
const clone = template.content.cloneNode(true);&lt;br&gt;
clone.querySelector(".title").textContent = "Product Name";&lt;br&gt;
clone.querySelector(".description").textContent = "Product Description";&lt;br&gt;
document.body.appendChild(clone);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ 3. Template Functions or Rendering Templates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can create your own template functions to build strings or HTML based on data:&lt;/p&gt;

&lt;p&gt;function renderUser(user) {&lt;br&gt;
  return &lt;code&gt;&lt;br&gt;
    &amp;lt;div class="user"&amp;gt;&lt;br&gt;
      &amp;lt;h3&amp;gt;${user.name}&amp;lt;/h3&amp;gt;&lt;br&gt;
      &amp;lt;p&amp;gt;Age: ${user.age}&amp;lt;/p&amp;gt;&lt;br&gt;
    &amp;lt;/div&amp;gt;&lt;br&gt;
&lt;/code&gt;;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;const user = { name: "Bob", age: 30 };&lt;br&gt;
document.body.innerHTML = renderUser(user);&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JAVASCRIPT</title>
      <dc:creator>Haryniramesh</dc:creator>
      <pubDate>Wed, 28 May 2025 18:41:37 +0000</pubDate>
      <link>https://dev.to/haryniramesh_90cfe77bda94/javascript-493h</link>
      <guid>https://dev.to/haryniramesh_90cfe77bda94/javascript-493h</guid>
      <description>&lt;p&gt;&lt;strong&gt;Why use functions?&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reusability: Write code once and use it multiple times.
Modularity: Break down complex problems into smaller, manageable pieces.
Readability: Makes your code easier to understand and maintain.
Avoid Repetition: Prevents writing the same code over and over.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Ways to Define Functions in JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are several ways to define functions in JavaScript, each with its own nuances:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Function Declarations 
Function Expressions 
Arrow Functions 
Immediately Invoked Function Expressions 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;1. Arrow Function&lt;/strong&gt;&lt;br&gt;
const add = (a, b) =&amp;gt; a + b;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Anonymous Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const greet = function(name) {&lt;br&gt;
  return "Hello, " + name;&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;🧪 &lt;strong&gt;Example: Add Two Numbers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;function add(a, b) {&lt;br&gt;
  return a + b;&lt;br&gt;
}&lt;/p&gt;

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

&lt;p&gt;console.log(add(5, 3)); // Output: 8&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⌨️ Form and Input Handling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const form = document.forms[0];&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;input.value&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const name = document.getElementById("username").value;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Static variable</title>
      <dc:creator>Haryniramesh</dc:creator>
      <pubDate>Wed, 28 May 2025 17:34:23 +0000</pubDate>
      <link>https://dev.to/haryniramesh_90cfe77bda94/static-variable-3cpc</link>
      <guid>https://dev.to/haryniramesh_90cfe77bda94/static-variable-3cpc</guid>
      <description>&lt;h1&gt;
  
  
  Static Variables in Java
&lt;/h1&gt;

&lt;p&gt;Static variables in Java are class-level variables that are shared among all instances of the class. Here are the key characteristics:&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Class-level storage&lt;/strong&gt;: Belongs to the class rather than any specific instance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single copy&lt;/strong&gt;: Only one copy exists regardless of how many objects are created&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared access&lt;/strong&gt;: All instances share the same static variable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory allocation&lt;/strong&gt;: Created when the class is loaded and destroyed when the class is unloaded&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Declaration Syntax
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// static variable&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When to Use Static Variables
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;When you need a variable common to all objects of a class&lt;/li&gt;
&lt;li&gt;For constants (usually combined with &lt;code&gt;final&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;For maintaining counts or other shared states across instances&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Important Notes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Access&lt;/strong&gt;: Can be accessed using either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Class name: &lt;code&gt;MyClass.count&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Instance reference: &lt;code&gt;obj.count&lt;/code&gt; (not recommended)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Initialization&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Default values (0, null, false etc.) if not initialized&lt;/li&gt;
&lt;li&gt;Can be initialized at declaration or in static blocks&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Thread Safety&lt;/strong&gt;: Static variables are not thread-safe by default - need synchronization in multi-threaded environments&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;employeeCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// static variable&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;employeeCount&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;  &lt;span class="c1"&gt;// increments for each new Employee created&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Total employees: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;employeeCount&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// Output: 2&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Static variables are useful for maintaining shared state across all instances of a class, but should be used judiciously to avoid unintended side effects.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Using While Loop</title>
      <dc:creator>Haryniramesh</dc:creator>
      <pubDate>Thu, 17 Apr 2025 17:48:59 +0000</pubDate>
      <link>https://dev.to/haryniramesh_90cfe77bda94/using-while-loop-3g2p</link>
      <guid>https://dev.to/haryniramesh_90cfe77bda94/using-while-loop-3g2p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Program:&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;public static void main(String args[])&lt;br&gt;
{ &lt;br&gt;
 int num=1;&lt;br&gt;
 int meeting_point=0;&lt;br&gt;
 int no1=21, no2=43;  &lt;/p&gt;

&lt;p&gt;while(true)&lt;br&gt;
 {&lt;br&gt;
   if(num%no1==0 &amp;amp;&amp;amp; num%no2==0)&lt;br&gt;
    {&lt;br&gt;
      meeting_point+=1;&lt;br&gt;
   if(meeting_point==3)&lt;br&gt;
    {&lt;br&gt;
      System.out.println("Meeting point:" + num);&lt;br&gt;
      break;&lt;br&gt;
    }&lt;br&gt;
 }&lt;br&gt;
   num+=1;&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

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

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

&lt;p&gt;Meeting point:2709&lt;/p&gt;

</description>
      <category>programming</category>
      <category>java</category>
      <category>coding</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Variables in Java</title>
      <dc:creator>Haryniramesh</dc:creator>
      <pubDate>Thu, 17 Apr 2025 17:43:42 +0000</pubDate>
      <link>https://dev.to/haryniramesh_90cfe77bda94/variables-in-java-2d3e</link>
      <guid>https://dev.to/haryniramesh_90cfe77bda94/variables-in-java-2d3e</guid>
      <description>&lt;h1&gt;
  
  
  Static Variables in Java
&lt;/h1&gt;

&lt;p&gt;Static variables in Java are class-level variables that are shared among all instances of the class. Here are the key characteristics:&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Class-level storage&lt;/strong&gt;: Belongs to the class rather than any specific instance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single copy&lt;/strong&gt;: Only one copy exists regardless of how many objects are created&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared access&lt;/strong&gt;: All instances share the same static variable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory allocation&lt;/strong&gt;: Created when the class is loaded and destroyed when the class is unloaded&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Declaration Syntax
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// static variable&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When to Use Static Variables
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;When you need a variable common to all objects of a class&lt;/li&gt;
&lt;li&gt;For constants (usually combined with &lt;code&gt;final&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;For maintaining counts or other shared states across instances&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Important Notes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Access&lt;/strong&gt;: Can be accessed using either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Class name: &lt;code&gt;MyClass.count&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Instance reference: &lt;code&gt;obj.count&lt;/code&gt; (not recommended)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Initialization&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Default values (0, null, false etc.) if not initialized&lt;/li&gt;
&lt;li&gt;Can be initialized at declaration or in static blocks&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Thread Safety&lt;/strong&gt;: Static variables are not thread-safe by default - need synchronization in multi-threaded environments&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;employeeCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// static variable&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;employeeCount&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;  &lt;span class="c1"&gt;// increments for each new Employee created&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Total employees: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;employeeCount&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// Output: 2&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Static variables are useful for maintaining shared state across all instances of a class, but should be used judiciously to avoid unintended side effects.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Static and Non Static Members</title>
      <dc:creator>Haryniramesh</dc:creator>
      <pubDate>Tue, 01 Apr 2025 16:54:58 +0000</pubDate>
      <link>https://dev.to/haryniramesh_90cfe77bda94/static-and-non-static-members-209b</link>
      <guid>https://dev.to/haryniramesh_90cfe77bda94/static-and-non-static-members-209b</guid>
      <description>&lt;p&gt;&lt;strong&gt;1.Static Members (Class-Level)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Defined using static keyword.&lt;/li&gt;
&lt;li&gt;  Belongs to the class rather than an instance of the class.&lt;/li&gt;
&lt;li&gt;  Shared among all objects of the class.&lt;/li&gt;
&lt;li&gt;  Can be accessed without creating an instance of the class.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;class Example {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static int count = 0; // Static variable
static void displayCount() { // Static method
    System.out.println("Count: " + count);
}
&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;
        Example.count = 5; // Accessing static variable without creating an object&lt;br&gt;
        Example.displayCount(); // Calling static method&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

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

&lt;p&gt;Count: 5&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.Non-Static Members (Instance-Level)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Do not use static keyword.&lt;/li&gt;
&lt;li&gt; Each object of the class gets its own copy.&lt;/li&gt;
&lt;li&gt; Requires an object to access.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;class Example {&lt;br&gt;
    int count = 0; // Non-static variable&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void displayCount() { // Non-static method
    System.out.println("Count: " + count);
}
&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;
        Example obj1 = new Example();&lt;br&gt;
        Example obj2 = new Example();&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    obj1.count = 10;
    obj2.count = 20;

    obj1.displayCount(); // Output: Count: 10
    obj2.displayCount(); // Output: Count: 20
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

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

&lt;p&gt;Count: 10&lt;br&gt;
 Count: 20&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to Use Static?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ Use static when the data is shared across all instances (e.g., utility methods, constants).&lt;br&gt;
❌ Avoid static when each object should maintain its own data (e.g., object attributes).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to Use Non-Static?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ When each object should have different values.&lt;br&gt;
✅ When each object should have its own behavior.&lt;br&gt;
✅ When OOP features (Encapsulation, Polymorphism, Inheritance) are needed.&lt;br&gt;
✅ When memory should only be used when an object exists.&lt;br&gt;
❌ When data should be shared among all objects (e.g., static int totalEmployees).&lt;br&gt;
❌ When methods do not depend on object variables (e.g., static int square(int x)).&lt;br&gt;
❌ When memory efficiency matters (e.g., static configurations).&lt;br&gt;
❌ When working with constants (e.g., static final double PI).&lt;br&gt;
❌ When object creation is unnecessary (e.g., utility/helper methods).&lt;/p&gt;

</description>
    </item>
    <item>
      <title>PostgreSQL Joins</title>
      <dc:creator>Haryniramesh</dc:creator>
      <pubDate>Wed, 26 Mar 2025 05:52:18 +0000</pubDate>
      <link>https://dev.to/haryniramesh_90cfe77bda94/postgresql-joins-3fm2</link>
      <guid>https://dev.to/haryniramesh_90cfe77bda94/postgresql-joins-3fm2</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. INNER JOIN&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An INNER JOIN returns rows when there is at least one match in both tables. If there is no match, the row will not appear in the result set.&lt;/p&gt;

&lt;p&gt;SELECT employees.name, departments.name&lt;br&gt;
FROM employees&lt;br&gt;
INNER JOIN departments&lt;br&gt;
ON employees.department_id = departments.id;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. LEFT JOIN (or LEFT OUTER JOIN)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A LEFT JOIN returns all the rows from the left table and the matched rows from the right table. If there is no match, NULL values will be returned for columns from the right table.&lt;/p&gt;

&lt;p&gt;SELECT employees.name, departments.name&lt;br&gt;
FROM employees&lt;br&gt;
LEFT JOIN departments&lt;br&gt;
ON employees.department_id = departments.id;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. RIGHT JOIN (or RIGHT OUTER JOIN)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A RIGHT JOIN returns all rows from the right table and the matched rows from the left table. If there is no match, NULL values will be returned for columns from the left table.&lt;/p&gt;

&lt;p&gt;SELECT employees.nae, departments.name&lt;br&gt;
FROM employees&lt;br&gt;
RIGHT JOIN departments&lt;br&gt;
ON employees.department_id = departments.id;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. FULL JOIN (or FULL OUTER JOIN)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A FULL JOIN returns rows when there is a match in one of the tables. It returns NULL for the non-matching rows in both tables.&lt;/p&gt;

&lt;p&gt;SELECT employees.name, departments.name&lt;br&gt;
FROM employees&lt;br&gt;
FULL JOIN departments&lt;br&gt;
ON employees.department_id = departments.id;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>FUNCTIONS IN JAVASCRIPT</title>
      <dc:creator>Haryniramesh</dc:creator>
      <pubDate>Thu, 06 Mar 2025 08:34:28 +0000</pubDate>
      <link>https://dev.to/haryniramesh_90cfe77bda94/functions-in-javascript-2j47</link>
      <guid>https://dev.to/haryniramesh_90cfe77bda94/functions-in-javascript-2j47</guid>
      <description>&lt;p&gt;&lt;strong&gt;1.document.getElementsByClassName(className);&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It returns a live HTML Collection,if the DOM changes the HTML Collection will automatically update.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It returns a collection of elements with the given class name, so we need to loop them. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If no elements match, it returns an empty HTML Collection.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2.document.getElementsByTagName(tagName);&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It returns a live HTML Collection, meaning if the document is updated the HTML Collection will be updated automatically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It matches all elements with the specified tag name, and you can loop through the returned collection or access specific elements by index.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If no elements match, it returns an empty HTML Collection.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.Math.sqrt(x);&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The square root function is only defined for non-negative real numbers, so passing a negative number to Math.sqrt() will return NaN.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For complex numbers JavaScript does not directly handle them using Math.sqrt(). You would need a different approach or library for that.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4.Math.abs(x);&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is a built-in method that returns the absolute value of a number. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The absolute value of a number is its non-negative value, meaning it removes any negative sign.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5.document.getElementById(id);&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is a built-in method used to retrieve an element from the DOM by its ID attribute.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This method is one of the most common ways to interact with specific elements in an HTML document.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6.document.write(text);&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a method used to write text or HTML content directly to the document during the page's loading process.&lt;/li&gt;
&lt;/ul&gt;




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