<?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: Akshata</title>
    <description>The latest articles on DEV Community by Akshata (@naiqor).</description>
    <link>https://dev.to/naiqor</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%2F3408312%2F1bfc1024-f49c-48d5-8470-ac3cb4c55e93.jpg</url>
      <title>DEV Community: Akshata</title>
      <link>https://dev.to/naiqor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/naiqor"/>
    <language>en</language>
    <item>
      <title>Launch Your React Website on Netlify for Free: The Lazy Dev’s Guide 😪</title>
      <dc:creator>Akshata</dc:creator>
      <pubDate>Wed, 20 Aug 2025 05:47:25 +0000</pubDate>
      <link>https://dev.to/naiqor/launch-your-react-website-on-netlify-for-free-the-lazy-devs-guide-2f5k</link>
      <guid>https://dev.to/naiqor/launch-your-react-website-on-netlify-for-free-the-lazy-devs-guide-2f5k</guid>
      <description>&lt;p&gt;It feels so great when you buy a shirt, and while paying you find out another one is free. We all love free stuff, don’t we?&lt;/p&gt;

&lt;p&gt;Now, when you’re just starting to build your website, do you really want to pay for hosting before you’ve even earned a single dollar from it? I know even wealthy people like you wouldn’t say no to free hosting 😂.&lt;/p&gt;

&lt;p&gt;Luckily, there are several cloud platforms with free tiers. One of the best is Netlify.&lt;/p&gt;

&lt;p&gt;Netlify is a platform to build, deploy, and manage modern web apps—and yes, you can deploy your React app there without paying a dime.&lt;/p&gt;

&lt;p&gt;In this tutorial, I’ll show you how to do it. Don’t worry, I won’t be customizing the React app—we’ll stick with the boring default landing page. Why? Because I’m lazy 😪.&lt;/p&gt;




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

&lt;ol&gt;
&lt;li&gt;Open your workspace in Visual Studio Code.&lt;/li&gt;
&lt;li&gt;Open the terminal and create a new React App, using the command &lt;code&gt;npx create-react-app app-name&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Go to your app folder and run the command &lt;code&gt;npm start&lt;/code&gt;. React's default landing page should show up at &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Push your code to GitHub.&lt;/li&gt;
&lt;li&gt;Login to &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt; using Github account.
&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%2Fa18u7re3znx5af3cdnia.png" alt=" " width="800" height="431"&gt;
&lt;/li&gt;
&lt;li&gt;Enter Signup Questions.
&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%2F551ucx2p8a3hy6kswusv.png" alt=" " width="800" height="441"&gt;
&lt;/li&gt;
&lt;li&gt;From the List of Git providers select &lt;code&gt;GitHub&lt;/code&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%2F8vdx50w1xbxxyrz4d14v.png" alt=" " width="800" height="443"&gt;
&lt;/li&gt;
&lt;li&gt;Select and authorise Netlify to access your repository.
&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%2Fcdqx7reref6j8zo4luul.png" alt=" " width="800" height="437"&gt; &lt;/li&gt;
&lt;li&gt;Start deploying your React project.
&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%2Fjfgfqhn29a056yb5p49k.png" alt=" " width="800" height="410"&gt;
&lt;/li&gt;
&lt;li&gt;Below command is used to build your project
&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%2Flwx4fw2a578xqrkynvq0.png" alt=" " width="800" height="457"&gt;
&lt;/li&gt;
&lt;li&gt;Once your build is successful your website will be published.&lt;/li&gt;
&lt;li&gt;If you haven't given any name to your website Netlify will generate a random name. You can click on the link and open your website.
&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%2Fs2utchipu64hbjvztbsx.png" alt=" " width="800" height="471"&gt;
&lt;/li&gt;
&lt;li&gt;You can change the name of your website by navigating to Project Configuration-&amp;gt; Change Project Name.
&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%2Fc2tl2at63rvst1vlxpml.png" alt=" " width="800" height="474"&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%2Fw71qb1cu7ce12w02aekv.png" alt=" " width="800" height="483"&gt;
&lt;/li&gt;
&lt;li&gt;Now click on your website link and share your website.
&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%2Ff0ywyp8yy2vghrvqcsvt.png" alt=" " width="800" height="475"&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%2Fhmgb0qiqcfm88f1d1w6n.png" alt=" " width="800" height="482"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Boom! Your React app is online. And you didn’t even have to touch a server, configure domains, or sell your kidney for hosting fees. Netlify did all the heavy lifting while you sat back lazy (respect ✌️).&lt;/p&gt;

</description>
      <category>react</category>
      <category>deployment</category>
      <category>netlify</category>
      <category>frontend</category>
    </item>
    <item>
      <title>The HashSet Duplicate Illusion in Java 😏</title>
      <dc:creator>Akshata</dc:creator>
      <pubDate>Wed, 13 Aug 2025 23:13:58 +0000</pubDate>
      <link>https://dev.to/naiqor/the-hashset-duplicate-illusion-in-java-16p8</link>
      <guid>https://dev.to/naiqor/the-hashset-duplicate-illusion-in-java-16p8</guid>
      <description>&lt;p&gt;I came across this interesting question during a technical interview.&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 Employee {
    public int id;
    public String name;
    public int salary;

    public Employee(String name, int id, int salary) {
        this.id = id;
        this.name = name;
        this.salary = salary;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, salary);
    }

    @Override
    public String toString() {
        return "Employee [id=" + id + ", name=" + name + ", salary=" + salary + "]";
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null || getClass() != obj.getClass())
            return false;
        Employee other = (Employee) obj;
        return id == other.id &amp;amp;&amp;amp; Objects.equals(name, other.name) &amp;amp;&amp;amp; salary == other.salary;
    }
}

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Main {
    public static void main(String[] args) {
        Employee e1 = new Employee("Sam", 1, 20000);
        Employee e2 = new Employee("Sam", 1, 20000);
        Employee e3 = new Employee("Sam", 2, 20000);

        HashSet&amp;lt;Employee&amp;gt; hs = new HashSet&amp;lt;&amp;gt;();
        hs.add(e1);
        hs.add(e2); // same as e1 → won't be added
        hs.add(e3); // different id → will be added

        System.out.println("Before update---&amp;gt;");
        for (Employee e : hs) {
            System.out.println(e);
        }

        // Change a field that is part of hashCode/equals
        e3.id = 1;

        System.out.println("After update---&amp;gt;");
        for (Employee e : hs) {
            System.out.println(e);
        }
    }
}

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

&lt;/div&gt;



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

&lt;blockquote&gt;
&lt;p&gt;Before update---&amp;gt;&lt;br&gt;
Employee [id=2, name=Sam, salary=20000]&lt;br&gt;
Employee [id=1, name=Sam, salary=20000]&lt;/p&gt;

&lt;p&gt;After update---&amp;gt;&lt;br&gt;
Employee [id=1, name=Sam, salary=20000]&lt;br&gt;
Employee [id=1, name=Sam, salary=20000]&lt;/p&gt;

&lt;p&gt;(Order may vary as HashSet does not guarantee iteration order)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;❓ &lt;strong&gt;Why Does This Happen?&lt;/strong&gt;&lt;br&gt;
We know HashSet doesn’t allow duplicates, so why does the second print still show two identical employees?&lt;/p&gt;

&lt;p&gt;When you add an element, HashSet:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Calls hashCode() to find the correct bucket. &lt;/li&gt;
&lt;li&gt;If there’s already an element with the same hash, it calls 
equals() to check for equality. &lt;/li&gt;
&lt;li&gt;If they are equal, it does not add the element.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This check happens &lt;strong&gt;only at insertion&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you change e3.id after it’s already in the set, it's hashCode() result changes.&lt;/p&gt;

&lt;p&gt;However, the object remains in the bucket for its old hash value — HashSet does not automatically rehash or move elements when their data changes.&lt;/p&gt;

&lt;p&gt;This causes the set to appear to contain duplicates and can also make contains() or remove() behave unexpectedly.&lt;/p&gt;

&lt;p&gt;💯 &lt;strong&gt;How to Prevent This&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The safest way is to make objects immutable when they are used as keys in hash-based collections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example fix:&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 Employee {
    private final int id;
    private final String name;
    private final int salary;

    public Employee(String name, int id, int salary) {
        this.id = id;
        this.name = name;
        this.salary = salary;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, salary);
    }

    @Override
    public String toString() {
        return "Employee [id=" + id + ", name=" + name + ", salary=" + salary + "]";
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null || getClass() != obj.getClass())
            return false;
        Employee other = (Employee) obj;
        return id == other.id &amp;amp;&amp;amp; Objects.equals(name, other.name) &amp;amp;&amp;amp; salary == other.salary;
    }
}

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

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Changes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fields are private and final.&lt;/li&gt;
&lt;li&gt;No setters provided → prevents accidental modification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔗 &lt;strong&gt;Takeaway&lt;/strong&gt;&lt;br&gt;
When using HashSet or any HashMap keys:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Never mutate fields that participate in equals() and hashCode() after insertion.&lt;/li&gt;
&lt;li&gt;Prefer immutable classes for keys.&lt;/li&gt;
&lt;li&gt;If mutation is unavoidable:

&lt;ol&gt;
&lt;li&gt;Remove the object from the set.&lt;/li&gt;
&lt;li&gt;Update it.&lt;/li&gt;
&lt;li&gt;Then re-add it.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>hashset</category>
      <category>interview</category>
      <category>programming</category>
    </item>
    <item>
      <title>Java String Behavior: Quick Guide</title>
      <dc:creator>Akshata</dc:creator>
      <pubDate>Wed, 13 Aug 2025 21:21:57 +0000</pubDate>
      <link>https://dev.to/naiqor/java-string-behavior-quick-guide-f3m</link>
      <guid>https://dev.to/naiqor/java-string-behavior-quick-guide-f3m</guid>
      <description>&lt;p&gt;🔆 What is the output of the following block of code?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;String a1 = "Hello";
String a2 = "Hello";
System.out.println(a1 == a2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Both a1 and a2 point to the same string in the String pool — so == returns true.&lt;/p&gt;

&lt;p&gt;📌 &lt;strong&gt;What about this?&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;String b1 = new String("Hello");
String b2 = new String("Hello");
System.out.println(b1 == b2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Each new String("Hello") creates a new object in the heap, so b1 and b2 are different objects — even though the text is the same.&lt;/p&gt;

&lt;p&gt;📎 == checks if two variables point to the same object, not just equal text. Use .equals() to compare text.&lt;/p&gt;

&lt;p&gt;📌 &lt;strong&gt;Another 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;String c1 = "Hi";
c1 = c1 + "There";
String c2 = "HiThere";
System.out.println(c1 == c2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;"Hi" is a string literal stored in the pool.&lt;/li&gt;
&lt;li&gt;c1 + "There" is done at runtime, so a new string "HiThere" is created in the heap.&lt;/li&gt;
&lt;li&gt;c1 and c2 have the same content, but point to different objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✔️ &lt;strong&gt;How to Make It True&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;String c1 = "Hi";
c1 = c1 + "There";
String c2 = "HiThere";
String c3 = c1.intern();
System.out.println(c3 == c2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;c1 is a heap object.&lt;/li&gt;
&lt;li&gt;c2 is the pooled "HiThere" literal.&lt;/li&gt;
&lt;li&gt;c1.intern() returns the pooled version, so now c3 == c2.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>interview</category>
      <category>string</category>
      <category>programming</category>
    </item>
    <item>
      <title>Java String Behavior: Quick Guide</title>
      <dc:creator>Akshata</dc:creator>
      <pubDate>Sun, 03 Aug 2025 15:04:28 +0000</pubDate>
      <link>https://dev.to/naiqor/java-string-behavior-quick-guide-3jo6</link>
      <guid>https://dev.to/naiqor/java-string-behavior-quick-guide-3jo6</guid>
      <description>&lt;p&gt;🔆 What is the output of the following block of code?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;String a1 = "Hello";
String a2 = "Hello";
System.out.println(a1 == a2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Both a1 and a2 point to the same string in the String pool — so == returns true.&lt;/p&gt;

&lt;p&gt;📌 &lt;strong&gt;What about this?&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;String b1 = new String("Hello");
String b2 = new String("Hello");
System.out.println(b1 == b2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Each new String("Hello") creates a new object in the heap, so b1 and b2 are different objects — even though the text is the same.&lt;/p&gt;

&lt;p&gt;📎 == checks if two variables point to the same object, not just equal text. Use .equals() to compare text.&lt;/p&gt;

&lt;p&gt;📌 &lt;strong&gt;Another 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;String c1 = "Hi";
c1 = c1 + "There";
String c2 = "HiThere";
System.out.println(c1 == c2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;"Hi" is a string literal stored in the pool.&lt;/li&gt;
&lt;li&gt;c1 + "There" is done at runtime, so a new string "HiThere" is created in the heap.&lt;/li&gt;
&lt;li&gt;c1 and c2 have the same content, but point to different objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✔️ &lt;strong&gt;How to Make It True&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;String c1 = "Hi";
c1 = c1 + "There";
String c2 = "HiThere";
String c3 = c1.intern();
System.out.println(c3 == c2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;c1 is a heap object.&lt;/li&gt;
&lt;li&gt;c2 is the pooled "HiThere" literal.&lt;/li&gt;
&lt;li&gt;c1.intern() returns the pooled version, so now c3 == c2.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>interview</category>
      <category>strings</category>
      <category>code</category>
    </item>
  </channel>
</rss>
