<?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: Anush</title>
    <description>The latest articles on DEV Community by Anush (@ars_3010).</description>
    <link>https://dev.to/ars_3010</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%2F1301179%2Fe4b77998-b150-4a78-92ad-313d71da372c.png</url>
      <title>DEV Community: Anush</title>
      <link>https://dev.to/ars_3010</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ars_3010"/>
    <language>en</language>
    <item>
      <title>String Stream in C++</title>
      <dc:creator>Anush</dc:creator>
      <pubDate>Sun, 09 Jun 2024 05:31:15 +0000</pubDate>
      <link>https://dev.to/ars_3010/string-stream-in-c-5cof</link>
      <guid>https://dev.to/ars_3010/string-stream-in-c-5cof</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Stringstream Class in C++?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;stringstream is a part of the C++ Standard Library, included in the sstream header, and is used for performing input and output operations on strings. It allows you to treat a string like a stream (such as cin or cout), enabling formatted input and output operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Commonly Used Methods of Stringstream Class in C++&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;clear() :- To clear the stream.&lt;/li&gt;
&lt;li&gt;str()  :-  To get and set string object whose content is present in the stream. &lt;/li&gt;
&lt;li&gt;operator &amp;lt;&amp;lt;  :-  Add a string to the stringstream object. &lt;/li&gt;
&lt;li&gt;operator &amp;gt;&amp;gt;   :-  Read something from the stringstream object.&lt;/li&gt;
&lt;/ol&gt;

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

#include &amp;lt;iostream&amp;gt;
#include &amp;lt;sstream&amp;gt;
#include &amp;lt;string&amp;gt;

using namespace std;

int main() {
    // Create a stringstream object
    stringstream ss;

    // Using operator&amp;lt;&amp;lt; to add data to the stringstream
    ss &amp;lt;&amp;lt; "123 456 789";

    // Output the current content of the stringstream using str()
    cout &amp;lt;&amp;lt; "Initial stringstream content: " &amp;lt;&amp;lt; ss.str() &amp;lt;&amp;lt; endl;

    // Variables to hold extracted values
    int a, b, c;

    // Using operator&amp;gt;&amp;gt; to extract data from the stringstream
    ss &amp;gt;&amp;gt; a &amp;gt;&amp;gt; b &amp;gt;&amp;gt; c;

    // Display the extracted values
    cout &amp;lt;&amp;lt; "Extracted values: " &amp;lt;&amp;lt; a &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; b &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; c &amp;lt;&amp;lt; endl;

    // Clear the stringstream using clear()
    ss.clear();

    // Check the content after clearing (should be empty)
    cout &amp;lt;&amp;lt; "After clear() - current stringstream content: " &amp;lt;&amp;lt; ss.str() &amp;lt;&amp;lt; endl;

    // Set a new string to the stringstream using str()
    ss.str("987 654 321");

    // Output the new content of the stringstream
    cout &amp;lt;&amp;lt; "After str() set new content: " &amp;lt;&amp;lt; ss.str() &amp;lt;&amp;lt; endl;

    // Extract data from the stringstream again
    ss &amp;gt;&amp;gt; a &amp;gt;&amp;gt; b &amp;gt;&amp;gt; c;

    // Display the newly extracted values
    cout &amp;lt;&amp;lt; "Newly extracted values: " &amp;lt;&amp;lt; a &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; b &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; c &amp;lt;&amp;lt; endl;

    // Clear the stringstream and reset the stringstream content
    ss.clear();
    ss.str("");

    // Verify that the stringstream is cleared
    cout &amp;lt;&amp;lt; "Final stringstream content after clear and str reset: '" &amp;lt;&amp;lt; ss.str() &amp;lt;&amp;lt; "'" &amp;lt;&amp;lt; endl;

    return 0;
}



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

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fu4cvctfbpu4ee4yi4b7a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fu4cvctfbpu4ee4yi4b7a.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;n&lt;/code&gt; represents the size of the string content in the stream, and &lt;code&gt;m&lt;/code&gt; represents the size of the data being inserted or extracted.&lt;/p&gt;

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

// C++ program to demonstrate use of stringstream to count frequencies of words.
#include &amp;lt;bits/stdc++.h&amp;gt;

using namespace std;

void printFrequency(string st)
{
    // Each word it mapped to it's frequency
    map&amp;lt;string, int&amp;gt; FW;

    // Used for breaking words
    stringstream ss(st);

    // To store individual words
    string Word;

    while (ss &amp;gt;&amp;gt; Word)
        FW[Word]++;

    for (auto m : FW)
        cout &amp;lt;&amp;lt; m.first &amp;lt;&amp;lt; "-&amp;gt; " &amp;lt;&amp;lt; m.second &amp;lt;&amp;lt; "\n";
}


int main()
{
    string s = "May the force be with you";
    printFrequency(s);
    return 0;
}



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

&lt;/div&gt;

</description>
      <category>cpp</category>
      <category>programming</category>
      <category>stl</category>
      <category>string</category>
    </item>
    <item>
      <title>NVM Install On Your PC</title>
      <dc:creator>Anush</dc:creator>
      <pubDate>Sun, 02 Jun 2024 15:05:26 +0000</pubDate>
      <link>https://dev.to/ars_3010/nvm-install-on-your-pc-1l07</link>
      <guid>https://dev.to/ars_3010/nvm-install-on-your-pc-1l07</guid>
      <description>&lt;p&gt;NVM (Node Version Manager) is a popular tool for managing multiple versions of Node.js on a single machine. Here are some important commands for NVM:&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation Commands
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install NVM&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script installs the latest version of NVM. Replace `v0.&lt;/p&gt;

&lt;h3&gt;
  
  
  NVM (Node Version Manager) Important Commands
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install NVM&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command downloads and runs the NVM install script from the NVM GitHub repository.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Load NVM&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] &amp;amp;&amp;amp; printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"&lt;br&gt;
   [ -s "$NVM_DIR/nvm.sh" ] &amp;amp;&amp;amp; \. "$NVM_DIR/nvm.sh"&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is usually added to your shell profile file (&lt;code&gt;~/.bashrc&lt;/code&gt;, &lt;code&gt;~/.zshrc&lt;/code&gt;, etc.) to load NVM when you open a new terminal.&lt;/p&gt;

&lt;h4&gt;
  
  
  Basic Usage
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check NVM Version&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
nvm --version&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;List Installed Node Versions&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
  nvm ls&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;List Available Node Versions&lt;/strong&gt;:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
nvm ls-remote&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install a Specific Node Version&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
 nvm install &amp;lt;version&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Replace &lt;code&gt;&amp;lt;version&amp;gt;&lt;/code&gt; with the desired version number, e.g., &lt;code&gt;nvm install 16.13.0&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use a Specific Node Version&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
  nvm use &amp;lt;version&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Replace &lt;code&gt;&amp;lt;version&amp;gt;&lt;/code&gt; with the installed version number you want to use.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Set Default Node Version&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
nvm alias default &amp;lt;version&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This sets the default Node.js version to be used in new shell sessions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Uninstall a Specific Node Version&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
nvm uninstall &amp;lt;version&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Show Current Node Version&lt;/strong&gt;:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
nvm current&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Run Node with a Specific Version&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
 nvm run &amp;lt;version&amp;gt; &amp;lt;script.js&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Replace `&amp;lt;version&amp;gt;` with the Node.js version and `&amp;lt;script.js&amp;gt;` with the script you want to run.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Execute NPM Commands with Specific Node Version&lt;/strong&gt;:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
nvm exec &amp;lt;version&amp;gt; npm &amp;lt;command&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For example, &lt;code&gt;nvm exec 14.17.0 npm install&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Reinstall Packages from Current Version&lt;/strong&gt;:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
nvm reinstall-packages &amp;lt;version&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This reinstalls global packages from the specified version into the current version.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Get Help&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
nvm help&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;These commands cover the essential functionality of NVM, helping you to manage different Node.js versions efficiently.&lt;/p&gt;

</description>
      <category>node</category>
      <category>nvm</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Setting Up Project React and TypeScript Application with Vite and Tailwind CSS</title>
      <dc:creator>Anush</dc:creator>
      <pubDate>Sun, 02 Jun 2024 14:43:46 +0000</pubDate>
      <link>https://dev.to/ars_3010/setting-up-project-react-typescript-application-with-vite-and-tailwind-css-3nd</link>
      <guid>https://dev.to/ars_3010/setting-up-project-react-typescript-application-with-vite-and-tailwind-css-3nd</guid>
      <description>&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;br&gt;
Node.js installed on your machine&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1. Create a New Project with Vite&lt;/strong&gt;&lt;br&gt;
First, create a new React project using Vite. Open your terminal and run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest my-react-app -- --template react-ts
cd my-react-app
npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Install Tailwind CSS&lt;/strong&gt;&lt;br&gt;
Next, install Tailwind CSS and its dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Configure Tailwind CSS&lt;/strong&gt;&lt;br&gt;
Replace the contents of tailwind.config.cjs with the following configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  content: [
    "./index.html",
    "./src/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Add Tailwind Directives to Your CSS&lt;/strong&gt;&lt;br&gt;
Add the following directives to your src/index.css file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@tailwind base;
@tailwind components;
@tailwind utilities;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Start the Development Server&lt;/strong&gt;&lt;br&gt;
Finally, start the development server to see your project in action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>typescript</category>
      <category>tailwindcss</category>
      <category>vite</category>
    </item>
    <item>
      <title>String Vs StringBuffer Vs StringBuilder in Java 💪</title>
      <dc:creator>Anush</dc:creator>
      <pubDate>Wed, 28 Feb 2024 13:58:03 +0000</pubDate>
      <link>https://dev.to/ars_3010/string-vs-stringbuffer-vs-stringbuilder-in-java-594f</link>
      <guid>https://dev.to/ars_3010/string-vs-stringbuffer-vs-stringbuilder-in-java-594f</guid>
      <description>&lt;p&gt;String, StringBuffer, and StringBuilder are three classes used for string manipulation, but they differ in terms of mutability, synchronization, and performance characteristics:&lt;/p&gt;

&lt;h2&gt;
  
  
  String:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Immutable:&lt;/strong&gt; Once a String object is created, its value cannot be changed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thread-safe:&lt;/strong&gt; Immutable strings are inherently thread-safe.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory efficiency:&lt;/strong&gt; Because strings are immutable, modifying them (e.g., concatenation) creates new string objects, potentially leading to memory overhead, especially in scenarios with frequent string manipulation.&lt;/li&gt;
&lt;li&gt;Suitable for scenarios where the value of the string remains constant or changes infrequently.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  StringBuffer:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mutable:&lt;/strong&gt; StringBuffer objects can be modified after creation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thread-safe:&lt;/strong&gt; StringBuffer methods are synchronized, making them safe for use in multithreaded environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; Slower than StringBuilder due to synchronization.&lt;/li&gt;
&lt;li&gt;Suitable for scenarios where thread safety is required, such as in multithreaded applications or when concurrent access to strings is necessary&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  StringBuilder:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mutable:&lt;/strong&gt; StringBuilder objects can be modified after creation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not thread-safe:&lt;/strong&gt; StringBuilder methods are not synchronized, making them unsuitable for concurrent use in multithreaded environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; Faster than StringBuffer because it lacks synchronization overhead.&lt;/li&gt;
&lt;li&gt;Suitable for single-threaded scenarios where high-performance string manipulation is required, such as string concatenation within loops or when building strings dynamically.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
public class StringExample {
    public static void main(String[] args) {
        // Example of String
        String str = "Hello";
        str += " World"; // Concatenating " World" to the original string
        System.out.println("String: " + str); // Output: Hello World

        // Example of StringBuffer
        StringBuffer stringBuffer = new StringBuffer("Hello");
        stringBuffer.append(" World"); // Appending " World" to the original string
        System.out.println("StringBuffer: " + stringBuffer.toString()); // Output: Hello World

        // Example of StringBuilder
        StringBuilder stringBuilder = new StringBuilder("Hello");
        stringBuilder.append(" World"); // Appending " World" to the original string
        System.out.println("StringBuilder: " + stringBuilder.toString()); // Output: Hello World
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's a summary of their characteristics:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomuq961rt3bt8rdo7j12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomuq961rt3bt8rdo7j12.png" alt="Image description" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In summary, String is immutable and thread-safe, StringBuffer is mutable and thread-safe, and StringBuilder is mutable but not thread-safe. You should choose the appropriate class based on your specific requirements for mutability, thread safety, and performance.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>programmers</category>
    </item>
    <item>
      <title>How Java Works? 🚀</title>
      <dc:creator>Anush</dc:creator>
      <pubDate>Mon, 26 Feb 2024 15:03:11 +0000</pubDate>
      <link>https://dev.to/ars_3010/how-java-works-2aj8</link>
      <guid>https://dev.to/ars_3010/how-java-works-2aj8</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fahlyvv1qtrrv3knqwmpj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fahlyvv1qtrrv3knqwmpj.png" alt="Image description" width="800" height="88"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Compilation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java source code is written in human-readable form by developers. This source code typically resides in files with a .java extension.&lt;/li&gt;
&lt;li&gt;The Java compiler (javac) translates the source code into platform-independent bytecode. Bytecode is a set of instructions for the Java Virtual Machine (JVM) and is stored in files with a .class extension.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2.Java Virtual Machine (JVM):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The JVM is a virtual machine that provides an execution environment for Java bytecode.&lt;/li&gt;
&lt;li&gt;When a Java program is executed, the JVM loads the bytecode files generated by the compiler.&lt;/li&gt;
&lt;li&gt;It then interprets the bytecode instructions and translates them into native machine code instructions that are specific to the underlying hardware and operating system. This translation can be done dynamically during program execution using techniques like Just-In-Time (JIT) compilation.&lt;/li&gt;
&lt;li&gt;The JVM also manages memory allocation and deallocation, garbage collection, exception handling, and other runtime tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.Execution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once the bytecode is loaded and translated by the JVM, the Java program begins execution.&lt;/li&gt;
&lt;li&gt;The JVM follows the instructions provided by the bytecode, executing the program's logic step by step.&lt;/li&gt;
&lt;li&gt;Java applications can interact with the underlying system through APIs provided by the Java standard library and other libraries.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>programmers</category>
    </item>
    <item>
      <title>Difference between Compiled and Interpreted Language</title>
      <dc:creator>Anush</dc:creator>
      <pubDate>Mon, 26 Feb 2024 13:23:02 +0000</pubDate>
      <link>https://dev.to/ars_3010/difference-between-compiled-and-interpreted-language-2a8g</link>
      <guid>https://dev.to/ars_3010/difference-between-compiled-and-interpreted-language-2a8g</guid>
      <description>&lt;p&gt;Compiled and interpreted languages are two different approaches to executing code:&lt;/p&gt;

&lt;h2&gt;
  
  
  Compiled Language:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In a compiled language, the source code is translated entirely into machine code (binary) before execution. &lt;/li&gt;
&lt;li&gt;This translation process is done by a compiler, which converts the entire source code into an executable file or another form of machine code.&lt;/li&gt;
&lt;li&gt;The resulting compiled code is usually specific to the target platform (such as a particular operating system and processor architecture).&lt;/li&gt;
&lt;li&gt;Examples of compiled languages include C, C++, Rust, and Go.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Interpreted language
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In an interpreted language, the source code is executed line-by-line or statement-by-statement without the need for a separate compilation step.&lt;/li&gt;
&lt;li&gt;Instead of compiling the entire source code into machine code beforehand, an interpreter reads each line of the source code and executes it directly.&lt;/li&gt;
&lt;li&gt;This allows for more dynamic behavior as code can be modified and executed on-the-fly.&lt;/li&gt;
&lt;li&gt;Interpreted languages are often platform-independent since the interpreter itself abstracts away the underlying hardware.&lt;/li&gt;
&lt;li&gt;Examples of interpreted languages include Python, JavaScript, Ruby, and PHP.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some key differences between the two:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Execution Speed:&lt;/strong&gt; Compiled languages generally execute faster because the entire code is translated into machine code upfront. Interpreted languages may have a slight overhead as each line of code is translated and executed sequentially.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portability:&lt;/strong&gt; Interpreted languages are usually more portable because they can run on any platform with the appropriate interpreter. Compiled languages often require recompilation for different platforms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debugging&lt;/strong&gt;: Debugging compiled languages can sometimes be more challenging because the source code isn't directly executed. In interpreted languages, debugging can be more straightforward as you can inspect the code during runtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Development Cycle:&lt;/strong&gt; Compiled languages typically have a longer development cycle due to the compilation step. Interpreted languages offer a shorter development cycle since there's no separate compilation step required.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both approaches have their advantages and are suited to different tasks and preferences. Some languages, like Java, utilize a combination of both compilation and interpretation through the use of bytecode and a virtual machine&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:-&lt;/strong&gt;&lt;br&gt;
Java is often described as a "compiled" language, but it's more accurate to say that Java uses a combination of compilation and interpretation.&lt;br&gt;
Here's how it works:&lt;/p&gt;

&lt;p&gt;1.Compilation to Bytecode:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java source code is first compiled into an intermediate form called bytecode. This compilation step is done by the Java compiler (javac), which translates the human-readable Java source code into platform-independent bytecode instructions.&lt;/li&gt;
&lt;li&gt;Bytecode is not machine code; instead, it's a set of instructions for the Java Virtual Machine (JVM) to execute.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Interpretation by the Java Virtual Machine (JVM):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After compilation, the bytecode is executed by the Java Virtual Machine (JVM). The JVM is a runtime environment that interprets bytecode and manages memory, security, and other runtime aspects of Java programs.&lt;/li&gt;
&lt;li&gt;The JVM translates bytecode into native machine code instructions specific to the underlying hardware and operating system on which it's running. This translation is done dynamically during program execution.&lt;/li&gt;
&lt;li&gt;Additionally, modern JVM implementations often employ Just-In-Time (JIT) compilation techniques. JIT compilation involves translating frequently executed bytecode sequences into native machine code for improved performance.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>java</category>
      <category>cpp</category>
    </item>
  </channel>
</rss>
