<?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: Arul .A</title>
    <description>The latest articles on DEV Community by Arul .A (@aj_arul).</description>
    <link>https://dev.to/aj_arul</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%2F3527303%2F3c5dff93-3545-4372-aaff-852b43325841.jpg</url>
      <title>DEV Community: Arul .A</title>
      <link>https://dev.to/aj_arul</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aj_arul"/>
    <language>en</language>
    <item>
      <title>useReducer in React?</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Wed, 10 Jun 2026 15:47:00 +0000</pubDate>
      <link>https://dev.to/aj_arul/usereducer-in-react-45kc</link>
      <guid>https://dev.to/aj_arul/usereducer-in-react-45kc</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;React provides several hooks to manage in functional components.One of the mostly used hook in react.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is used in mostly when the state management is complex.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What is useReducer? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Usereducer is a react hook that manages state using &lt;strong&gt;reducer&lt;/strong&gt; function .Instead of update state directly,using dispatch action describe what should happen ,and the reducer decides how the state changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Syntax :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useReducer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;initialState&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;state – Current state value.&lt;/li&gt;
&lt;li&gt;dispatch – Function used to send actions.&lt;/li&gt;
&lt;li&gt;reducer – Function that updates the state.&lt;/li&gt;
&lt;li&gt;initialState – Initial value of the state.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why use useReducer?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;While useState is perfect for simple state updates, useReducer is better when:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1.State contains multiple values.&lt;br&gt;
2.State update logic is complex.&lt;br&gt;
3.Multiple actions affect the same state.&lt;br&gt;
4.You want cleaner and more organized code.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>react</category>
      <category>learning</category>
    </item>
    <item>
      <title>Why Java?</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Tue, 09 Jun 2026 14:33:07 +0000</pubDate>
      <link>https://dev.to/aj_arul/why-java-nnn</link>
      <guid>https://dev.to/aj_arul/why-java-nnn</guid>
      <description>&lt;h1&gt;
  
  
  Java
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Java is an Object-Oriented Programming (OOP) language.&lt;/li&gt;
&lt;li&gt;It is platform-independent, following the principle &lt;strong&gt;"Write Once, Run Anywhere (WORA)"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;It is highly secure and is widely used in banking, enterprise, and business applications.&lt;/li&gt;
&lt;li&gt;Java is robust because of its strong error handling and memory management features.&lt;/li&gt;
&lt;li&gt;Java has a large community with a huge number of libraries, frameworks, and learning resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where Java is Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Enterprise Applications&lt;/li&gt;
&lt;li&gt;Banking Systems&lt;/li&gt;
&lt;li&gt;E-commerce Websites&lt;/li&gt;
&lt;li&gt;Backend APIs&lt;/li&gt;
&lt;li&gt;Desktop Applications&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Applications Built Using Java
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Netflix&lt;/li&gt;
&lt;li&gt;Spotify&lt;/li&gt;
&lt;li&gt;Uber&lt;/li&gt;
&lt;li&gt;Twitter&lt;/li&gt;
&lt;li&gt;LinkedIn&lt;/li&gt;
&lt;li&gt;NASA World Wind&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What Are JavaScript Libraries and Frameworks?</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Mon, 08 Jun 2026 16:33:21 +0000</pubDate>
      <link>https://dev.to/aj_arul/what-are-javascript-libraries-and-frameworks-3a0n</link>
      <guid>https://dev.to/aj_arul/what-are-javascript-libraries-and-frameworks-3a0n</guid>
      <description>&lt;h1&gt;
  
  
  What Are JavaScript Libraries and Frameworks?
&lt;/h1&gt;

&lt;p&gt;JavaScript is a popular programming language used to create interactive websites and web applications. To make development easier and faster, developers use libraries and frameworks. These tools provide pre-written code that helps reduce development time and improve productivity.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a JavaScript Library?
&lt;/h2&gt;

&lt;p&gt;A JavaScript library is a collection of pre-written functions and code that developers can use whenever needed. The developer remains in control and decides when and where to use the library's features.&lt;/p&gt;

&lt;p&gt;Some popular JavaScript libraries include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React – Used for building user interfaces.&lt;/li&gt;
&lt;li&gt;jQuery – Simplifies DOM manipulation and event handling.&lt;/li&gt;
&lt;li&gt;Axios – Helps make HTTP requests to APIs.&lt;/li&gt;
&lt;li&gt;Lodash – Provides utility functions for working with data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advantages of Libraries
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Easy to learn and use&lt;/li&gt;
&lt;li&gt;Flexible and lightweight&lt;/li&gt;
&lt;li&gt;Can be integrated into existing projects&lt;/li&gt;
&lt;li&gt;Reduces development effort&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is a JavaScript Framework?
&lt;/h2&gt;

&lt;p&gt;A JavaScript framework is a complete structure for building applications. It provides predefined architecture, tools, and guidelines that developers follow while creating applications. In a framework, the framework controls the overall flow of the application.&lt;/p&gt;

&lt;p&gt;Some popular JavaScript frameworks include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Angular – A full-featured framework developed by Google.&lt;/li&gt;
&lt;li&gt;Vue.js – A progressive framework for building user interfaces.&lt;/li&gt;
&lt;li&gt;Next.js – A React-based framework for web applications.&lt;/li&gt;
&lt;li&gt;Nuxt.js – A framework built on top of Vue.js.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advantages of Frameworks
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Provides a structured development approach&lt;/li&gt;
&lt;li&gt;Includes many built-in features&lt;/li&gt;
&lt;li&gt;Suitable for large-scale applications&lt;/li&gt;
&lt;li&gt;Encourages best coding practices&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Difference Between Libraries and Frameworks
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Library&lt;/th&gt;
&lt;th&gt;Framework&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Developer controls the flow of the application&lt;/td&gt;
&lt;td&gt;Framework controls the flow of the application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Used for specific tasks&lt;/td&gt;
&lt;td&gt;Used to build complete applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;More flexible&lt;/td&gt;
&lt;td&gt;More structured&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Easier to learn&lt;/td&gt;
&lt;td&gt;Usually has a steeper learning curve&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Examples: React, jQuery, Axios&lt;/td&gt;
&lt;td&gt;Examples: Angular, Vue.js, Next.js&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Real-Life Example
&lt;/h2&gt;

&lt;p&gt;Think of a library as a toolbox. You choose the tools you need and use them whenever required.&lt;/p&gt;

&lt;p&gt;Think of a framework as a house blueprint. It provides a complete plan and guides how everything should be built.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Difference Between == and equals() in Java</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Sun, 07 Jun 2026 16:34:50 +0000</pubDate>
      <link>https://dev.to/aj_arul/difference-between-and-equals-in-java-2c76</link>
      <guid>https://dev.to/aj_arul/difference-between-and-equals-in-java-2c76</guid>
      <description>&lt;p&gt;What is ==?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The operator is used reference comparison.&lt;/li&gt;
&lt;li&gt;It compares whether two variables refer to the same object in memory.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;s1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Java"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;s2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Java"&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="n"&gt;s1&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, s1 and s2 contain the same text, but they are stored in different memory locations. Therefore, == returns false.&lt;/p&gt;

&lt;p&gt;What is equals()?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The equals() method compares the actual content or values of two objects.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;s1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Java"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;s2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Java"&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="n"&gt;s1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;equals&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The content of both strings is "Java", so equals() returns true.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>interview</category>
    </item>
    <item>
      <title>Why Use UTF-8 in File Handling?</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Sat, 06 Jun 2026 13:45:04 +0000</pubDate>
      <link>https://dev.to/aj_arul/why-use-utf-8-in-file-handling-186j</link>
      <guid>https://dev.to/aj_arul/why-use-utf-8-in-file-handling-186j</guid>
      <description>&lt;ul&gt;
&lt;li&gt;UTF-8 is a character encoding standard.It is used to store and read text files correctly.
-It supports mostly all languages and special characters.Nowadays mostly is used for encoding format.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Benefits of UTF-8:&lt;/p&gt;

&lt;p&gt;1.Supports Multiple Languages &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;UTF-8 can store text from different languages such as:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;English: Hello&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tamil: வணக்கம்&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hindi: नमस्ते&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Chinese: 你好&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This ensures that users from different regions can read the file correctly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Prevents Character Corruption&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If a file is written using one encoding and read using another, the text may appear as unreadable symbols. Using UTF-8 consistently prevents this problem.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cross-Platform Compatibility&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;UTF-8 is supported by most operating systems, programming languages, databases, and web browsers. Files encoded in UTF-8 can be shared easily between different systems.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Supports Special Characters and Emojis&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;UTF-8 can store symbols, currency signs, and emojis such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;₹  ©  ®  😊
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Reading a file using UTF-8:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;BufferedReader&lt;/span&gt; &lt;span class="n"&gt;br&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BufferedReader&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;InputStreamReader&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;FileInputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"data.txt"&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
        &lt;span class="s"&gt;"UTF-8"&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;In this example, Java reads the file using UTF-8 encoding, ensuring that all characters are displayed correctly.&lt;/p&gt;

</description>
      <category>java</category>
      <category>filehandilng</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Understanding File, FileReader, FileWriter, BufferedReader, and BufferedWriter in Java</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Fri, 05 Jun 2026 12:51:51 +0000</pubDate>
      <link>https://dev.to/aj_arul/understanding-file-filereader-filewriter-bufferedreader-and-bufferedwriter-in-java-240j</link>
      <guid>https://dev.to/aj_arul/understanding-file-filereader-filewriter-bufferedreader-and-bufferedwriter-in-java-240j</guid>
      <description>&lt;ol&gt;
&lt;li&gt;File Class :&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;The file class is represents file or directory(folder).They used to file related operations such as creating,deleting,renaming,check whether file or folder.&lt;/li&gt;
&lt;li&gt;However the file does not write or read.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;File&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"data.txt"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;exists&lt;/span&gt;&lt;span class="o"&gt;())&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;"File exists"&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;2.FileReader:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The FileReader is used to read text data from a file by character by character.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is suitable for reading small text files.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;FileReader&lt;/span&gt; &lt;span class="n"&gt;fr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileReader&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"data.txt"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;read&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&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;print&lt;/span&gt;&lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;fr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;FileWriter :&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;The FileWriter is used to write text data into a file . If the file does not exist ,java creates file automatically.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;FileWriter&lt;/span&gt; &lt;span class="n"&gt;fw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileWriter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"data.txt"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;fw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;write&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello Java"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;fw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;BufferedReader :&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;The BufferReader is used to improves reading performance by instead of using internal buffer.&lt;/li&gt;
&lt;li&gt;Instead of accessing the file for every character, it reads a larger block of data into memory. It also provides the convenient readLine() method. &lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;BufferedReader&lt;/span&gt; &lt;span class="n"&gt;br&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;BufferedReader&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;FileReader&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"data.txt"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;br&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;readLine&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;)&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="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;br&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.BufferedWriter :&lt;/p&gt;

&lt;p&gt;-The BufferedWriter is used to write text data improves writing performance by storing data in a buffer before writing it to the file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The reduces the number of disk operatins and makes file writing faster.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;BufferedWriter&lt;/span&gt; &lt;span class="n"&gt;bw&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;BufferedWriter&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;FileWriter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"data.txt"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

&lt;span class="n"&gt;bw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;write&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;bw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;newLine&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;bw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;write&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Java"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;bw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>java</category>
      <category>filehandling</category>
    </item>
    <item>
      <title>Why Use Mostly IOException in File Handling in Java?</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Wed, 03 Jun 2026 16:07:04 +0000</pubDate>
      <link>https://dev.to/aj_arul/why-use-mostly-ioexception-in-file-handling-in-java-3nll</link>
      <guid>https://dev.to/aj_arul/why-use-mostly-ioexception-in-file-handling-in-java-3nll</guid>
      <description>&lt;p&gt;When working with files in Java, many operations can fail. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The file may not exist.&lt;/li&gt;
&lt;li&gt;The file may be locked by another program.&lt;/li&gt;
&lt;li&gt;The user may not have permission to access the file.&lt;/li&gt;
&lt;li&gt;The disk may be full.&lt;/li&gt;
&lt;li&gt;A read or write operation may fail unexpectedly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of these possible errors, Java uses IOException to handle file-related problems.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileWriter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.IOException&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;class&lt;/span&gt; &lt;span class="nc"&gt;Example&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;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;FileWriter&lt;/span&gt; &lt;span class="n"&gt;writer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileWriter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"data.txt"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;writer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;write&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello Java"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;writer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&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;"File error occurred"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&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;Why IOException?&lt;/p&gt;

&lt;p&gt;FileWriter, FileReader, BufferedReader, BufferedWriter, and many other file classes can throw IOException.&lt;/p&gt;

&lt;p&gt;Since Java forces us to handle checked exceptions, we must either:&lt;/p&gt;

&lt;p&gt;Use try-catch&lt;br&gt;
Or declare throws IOException&lt;/p&gt;

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

&lt;p&gt;catch (IOException e)&lt;/p&gt;

&lt;p&gt;This catches file-related errors and prevents the program from crashing.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IOException is used in Java file handling because file operations are not guaranteed to succeed. Files may be missing, inaccessible, or fail during reading and writing. By catching IOException, we can handle these errors safely and prevent our program from crashing.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>pro</category>
      <category>programming</category>
      <category>java</category>
    </item>
    <item>
      <title>Why useEffect Causes Infinite Loops in React?</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Tue, 26 May 2026 13:00:49 +0000</pubDate>
      <link>https://dev.to/aj_arul/why-useeffect-causes-infinite-loops-in-react-4dk5</link>
      <guid>https://dev.to/aj_arul/why-useeffect-causes-infinite-loops-in-react-4dk5</guid>
      <description>&lt;p&gt;React’s &lt;code&gt;useEffect()&lt;/code&gt; Hook is used for side effects like API calls, timers, and event listeners. One common beginner mistake is creating infinite loops inside &lt;code&gt;useEffect()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Example of wrong code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates an infinite loop because:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Component renders&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;useEffect()&lt;/code&gt; runs&lt;/li&gt;
&lt;li&gt;State updates&lt;/li&gt;
&lt;li&gt;Component re-renders&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;useEffect()&lt;/code&gt; runs again&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This process repeats forever.&lt;/p&gt;

&lt;p&gt;The correct way is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The empty dependency array &lt;code&gt;[]&lt;/code&gt; tells React to run the effect only once after the first render.&lt;/p&gt;

&lt;p&gt;Dependency array behavior:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No dependency array → runs after every render&lt;/li&gt;
&lt;li&gt;Empty array &lt;code&gt;[]&lt;/code&gt; → runs once&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[value]&lt;/code&gt; → runs when value changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another common mistake is using objects or functions in dependency arrays because React compares references, not actual values.&lt;/p&gt;

&lt;p&gt;Best practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use dependency arrays correctly&lt;/li&gt;
&lt;li&gt;Avoid unnecessary state updates&lt;/li&gt;
&lt;li&gt;Keep &lt;code&gt;useEffect()&lt;/code&gt; simple&lt;/li&gt;
&lt;li&gt;Understand React rendering flow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding &lt;code&gt;useEffect()&lt;/code&gt; properly helps developers avoid performance issues and debugging problems in React applications.&lt;/p&gt;

</description>
      <category>react</category>
      <category>loops</category>
      <category>programming</category>
    </item>
    <item>
      <title>Difference Between JavaScript (.js) and JSX (.jsx)</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Sat, 23 May 2026 17:04:56 +0000</pubDate>
      <link>https://dev.to/aj_arul/difference-between-javascript-js-and-jsx-jsx-307p</link>
      <guid>https://dev.to/aj_arul/difference-between-javascript-js-and-jsx-jsx-307p</guid>
      <description>&lt;p&gt;JavaScript and JSX are closely related technologies used in modern web development, especially in React applications.&lt;/p&gt;

&lt;p&gt;-What is JavaScript (.js)?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;JavaScript is a programming language used to create dynamic and interactive web applications. Files with the .js extension contain pure JavaScript code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JavaScript is commonly used for:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1.Variables and functions&lt;br&gt;
2.Loops and conditions&lt;br&gt;
3.API calls&lt;br&gt;
4.Event handling&lt;br&gt;
5.DOM manipulation&lt;br&gt;
6.Business logic&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What is JSX (.jsx)?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSX stands for JavaScript XML. It is a syntax extension for JavaScript that allows developers to write HTML-like code inside JavaScript.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSX is mainly used in React to create user interface components.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello React&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>programming</category>
      <category>frontend</category>
      <category>react</category>
    </item>
    <item>
      <title>Difference Between @PathVariable and @RequestParam</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Fri, 22 May 2026 17:37:37 +0000</pubDate>
      <link>https://dev.to/aj_arul/difference-between-pathvariable-and-requestparam-3d3i</link>
      <guid>https://dev.to/aj_arul/difference-between-pathvariable-and-requestparam-3d3i</guid>
      <description>&lt;p&gt;Both @PathVariable and @RequestParam are used to receive data from the client request in Spring Boot.But they work in completely different ways.&lt;/p&gt;

&lt;p&gt;What is @PathVariable?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;@PathVariable is used to get values directly from the URL path.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@GetMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/product/{id}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;getProduct&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@PathVariable&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Product ID: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;id&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;URL:&lt;/p&gt;

&lt;p&gt;/product/10&lt;/p&gt;

&lt;p&gt;Here:&lt;/p&gt;

&lt;p&gt;id = 10 =&amp;gt; The value 10 becomes part of the URL path itself.&lt;/p&gt;

&lt;p&gt;Usually used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specific resource IDs&lt;/li&gt;
&lt;li&gt;Mandatory values&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unique objects&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What is @RequestParam?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;@RequestParam gets values from query parameters.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@GetMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/products"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@RequestParam&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;category&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;URL:&lt;/p&gt;

&lt;p&gt;/products?category=mobile&lt;/p&gt;

&lt;p&gt;Here:&lt;/p&gt;

&lt;p&gt;category = "mobile"&lt;/p&gt;

&lt;p&gt;Usually used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Filtering&lt;/li&gt;
&lt;li&gt;Searching&lt;/li&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Pagination&lt;/li&gt;
&lt;li&gt;Optional data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/products?category=mobile
/products?page=2
/products?sort=price
/products?search=iphone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are not unique resources.&lt;/p&gt;

&lt;p&gt;They are conditions or filters.&lt;/p&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is Maven?And Pom.xml?</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Wed, 06 May 2026 04:58:18 +0000</pubDate>
      <link>https://dev.to/aj_arul/what-is-mavenand-pomxml-22d2</link>
      <guid>https://dev.to/aj_arul/what-is-mavenand-pomxml-22d2</guid>
      <description>&lt;p&gt;What is Maven in Spring Boot?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Maven is a build automation and project management tool used in Java projects. In Spring Boot, Maven handles:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Downloading dependencies (libraries/jars) automatically&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Compiling your Java code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Running tests&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Packaging your app into a .jar or .war file&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploying your application&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What Maven Actually Does&lt;/p&gt;

&lt;p&gt;Maven mainly handles 3 things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dependency Management&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It downloads required libraries automatically.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
You want to use MySQL in Spring Boot.&lt;/p&gt;

&lt;p&gt;Without Maven:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;search MySQL connector online&lt;/li&gt;
&lt;li&gt;download jar&lt;/li&gt;
&lt;li&gt;add to project manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With Maven:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;just add this in pom.xml
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;mysql&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;mysql-connector-j&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;8.3.0&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Maven downloads it automatically from the Maven repository.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build Automation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Maven can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compile code&lt;/li&gt;
&lt;li&gt;run tests&lt;/li&gt;
&lt;li&gt;package project&lt;/li&gt;
&lt;li&gt;create .jar or .war&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of: javac Main.java&lt;/p&gt;

&lt;p&gt;You simply run: mvn compile&lt;/p&gt;

&lt;p&gt;To create a JAR: mvn package&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Standard Project Structure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Maven forces a clean structure.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project-name/
│
├── src/
│   ├── main/
│   │   ├── java/
│   │   └── resources/
│   │
│   └── test/
│       └── java/
│
├── pom.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;What is pom.xml ?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the heart of Maven.&lt;/p&gt;

&lt;p&gt;POM = Project Object Model&lt;/p&gt;

&lt;p&gt;It contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;project name&lt;/li&gt;
&lt;li&gt;dependencies&lt;/li&gt;
&lt;li&gt;plugins&lt;/li&gt;
&lt;li&gt;Java version&lt;/li&gt;
&lt;li&gt;build settings&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;project&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://maven.apache.org/POM/4.0.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;modelVersion&amp;gt;&lt;/span&gt;4.0.0&lt;span class="nt"&gt;&amp;lt;/modelVersion&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;com.example&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;demo&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;1.0&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;dependencies&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;spring-boot-starter-web&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;3.2.5&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;/dependencies&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important Maven Commands :&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mvn compile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Compiles code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mvn test&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runs tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mvn package&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates JAR/WAR&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mvn clean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deletes old build files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mvn install&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Installs into local repository&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>springboot</category>
      <category>java</category>
      <category>react</category>
      <category>programming</category>
    </item>
    <item>
      <title>Spring Boot MVC Explained: Build Smarter Web Apps with Model-View-Controller</title>
      <dc:creator>Arul .A</dc:creator>
      <pubDate>Tue, 05 May 2026 07:19:52 +0000</pubDate>
      <link>https://dev.to/aj_arul/spring-boot-mvc-explained-build-smarter-web-apps-with-model-view-controller-b4c</link>
      <guid>https://dev.to/aj_arul/spring-boot-mvc-explained-build-smarter-web-apps-with-model-view-controller-b4c</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When building applications with Spring Boot, one of the most important architectural patterns you’ll encounter is &lt;strong&gt;MVC (Model-View-Controller)&lt;/strong&gt;. Many developers claim to “use MVC,” but in reality, they only use annotations like &lt;code&gt;@RestController&lt;/code&gt; without understanding the separation of responsibilities.&lt;/p&gt;

&lt;p&gt;This article breaks MVC down properly—what it is, how Spring Boot implements it, and how to use it correctly in real-world applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is MVC?
&lt;/h2&gt;

&lt;p&gt;MVC stands for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Model&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;View&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Controller&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is a design pattern that separates an application into three layers, each with a distinct responsibility. The goal is to reduce code complexity and improve maintainability.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why MVC Matters (No-Nonsense Explanation)
&lt;/h2&gt;

&lt;p&gt;If you don’t follow MVC:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your controller becomes a dumping ground&lt;/li&gt;
&lt;li&gt;Business logic gets duplicated everywhere&lt;/li&gt;
&lt;li&gt;Debugging becomes painful&lt;/li&gt;
&lt;li&gt;Scaling the application becomes difficult&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  MVC in Spring Boot
&lt;/h2&gt;

&lt;p&gt;Spring Boot uses &lt;strong&gt;Spring MVC&lt;/strong&gt;, which provides built-in support for this architecture using annotations and conventions.&lt;/p&gt;

&lt;p&gt;Typical layers in a Spring Boot MVC application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Controller → Service → Repository → Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  1. Model Layer (Data + Business Logic)
&lt;/h2&gt;

&lt;p&gt;The Model represents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application data&lt;/li&gt;
&lt;li&gt;Business rules&lt;/li&gt;
&lt;li&gt;Database interaction&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Components:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Entity classes (&lt;code&gt;@Entity&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Repository interfaces (&lt;code&gt;JpaRepository&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Sometimes DTOs&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Entity&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Id&lt;/span&gt;
    &lt;span class="nd"&gt;@GeneratedValue&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Long&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// getters and setters&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Repository:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Repository&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;UserRepository&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;JpaRepository&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Long&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&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;h2&gt;
  
  
  2. View Layer (What the User Sees)
&lt;/h2&gt;

&lt;p&gt;The View is responsible for presenting data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two common types in Spring Boot:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Traditional MVC
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Thymeleaf&lt;/li&gt;
&lt;li&gt;JSP&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. REST APIs (Most common today)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;JSON responses&lt;/li&gt;
&lt;li&gt;Used with frontend frameworks (React, Angular)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example (JSON View):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Arul"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arul@example.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Controller Layer (Request Handling)
&lt;/h2&gt;

&lt;p&gt;The Controller:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Receives HTTP requests&lt;/li&gt;
&lt;li&gt;Validates input&lt;/li&gt;
&lt;li&gt;Calls the service layer&lt;/li&gt;
&lt;li&gt;Returns response&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@RestController&lt;/span&gt;
&lt;span class="nd"&gt;@RequestMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/users"&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;class&lt;/span&gt; &lt;span class="nc"&gt;UserController&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Autowired&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;UserService&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@GetMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/{id}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@PathVariable&lt;/span&gt; &lt;span class="nc"&gt;Long&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getUserById&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;);&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;h2&gt;
  
  
  4. Service Layer (The Most Ignored Layer)
&lt;/h2&gt;

&lt;p&gt;This is where most beginners fail.&lt;/p&gt;

&lt;p&gt;The Service layer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Contains business logic&lt;/li&gt;
&lt;li&gt;Acts as a bridge between Controller and Repository&lt;/li&gt;
&lt;li&gt;Keeps controllers clean&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Service&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserService&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Autowired&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;UserRepository&lt;/span&gt; &lt;span class="n"&gt;repo&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="nf"&gt;getUserById&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Long&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;repo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findById&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                   &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;orElseThrow&lt;/span&gt;&lt;span class="o"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RuntimeException&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"User not found"&lt;/span&gt;&lt;span class="o"&gt;));&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;h2&gt;
  
  
  How MVC Flow Works (Step-by-Step)
&lt;/h2&gt;

&lt;p&gt;Let’s say a client requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /users/1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Flow:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Request hits &lt;strong&gt;Controller&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Controller calls &lt;strong&gt;Service&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Service calls &lt;strong&gt;Repository&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Repository fetches data from &lt;strong&gt;Database&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Data returns to Service&lt;/li&gt;
&lt;li&gt;Service returns to Controller&lt;/li&gt;
&lt;li&gt;Controller sends response to client (View)&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Real Project Structure
&lt;/h2&gt;

&lt;p&gt;A clean Spring Boot project should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;com.example.project
│
├── controller
├── service
├── repository
├── model
└── dto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your project doesn’t look like this (or similar), you’re probably mixing responsibilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of MVC
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Clear separation of concerns&lt;/li&gt;
&lt;li&gt;Easier debugging&lt;/li&gt;
&lt;li&gt;Scalable architecture&lt;/li&gt;
&lt;li&gt;Better team collaboration&lt;/li&gt;
&lt;li&gt;Reusable components&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>springboot</category>
      <category>java</category>
      <category>programming</category>
      <category>design</category>
    </item>
  </channel>
</rss>
