<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>SpringSoft</title>
    <description>SpringSoft offers a comprehensive suite of services including Email Marketing, SMS Marketing, AWS Cloud Services, Web and Mobile Application Development, Data Technology Consulting, and System Upscaling. We specialize in creating custom software solutions tailored to your needs, ensuring your systems are not only scalable but also maintainable. Partner with us to take your technology to the next level.</description>
    <link>https://spring-soft.com</link>
    <atom:link href="https://spring-soft.com/feed.xml" rel="self" type="application/rss+xml" />
    
      <item>
        <title>Friend Circles – Coding Interview Problem</title>
        <description>&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Graph&lt;/td&gt;
      &lt;td&gt;Depth First Search&lt;/td&gt;
      &lt;td&gt;Breadth First Search&lt;/td&gt;
      &lt;td&gt;Union Find&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;There are &lt;strong&gt;N students&lt;/strong&gt; in a class. Some of them are friends, while others are not. Friendship is &lt;strong&gt;transitive&lt;/strong&gt;: - If A is a friend of B - And B is a friend of C - Then A is also a friend of C A &lt;strong&gt;friend circle&lt;/strong&gt; is a group of students who are directly or indirectly friends. You must implement: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;int friendCircles(char[][] friends)&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;int friendCircles(List&amp;lt;String&amp;gt; friends)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This function returns the &lt;strong&gt;number of friend circles&lt;/strong&gt; in the class.&lt;/p&gt;

&lt;p&gt;The input &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;friends&lt;/code&gt; is an &lt;strong&gt;N × N matrix&lt;/strong&gt; of characters &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&apos;Y&apos;&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&apos;N&apos;&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;friends[i][j] = &apos;Y&apos;&lt;/code&gt; → student &lt;em&gt;i&lt;/em&gt; and student &lt;em&gt;j&lt;/em&gt; are friends&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;friends[i][j] = &apos;N&apos;&lt;/code&gt; → they are not friends&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Self‑connections such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(0,0)&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(1,1)&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(2,2)&lt;/code&gt; should &lt;strong&gt;not&lt;/strong&gt; be counted as edges.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;example&quot;&gt;Example&lt;/h2&gt;

&lt;p&gt;Given the matrix:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt; &lt;/th&gt;
      &lt;th&gt;0&lt;/th&gt;
      &lt;th&gt;1&lt;/th&gt;
      &lt;th&gt;2&lt;/th&gt;
      &lt;th&gt;3&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;0&lt;/td&gt;
      &lt;td&gt;Y&lt;/td&gt;
      &lt;td&gt;Y&lt;/td&gt;
      &lt;td&gt;N&lt;/td&gt;
      &lt;td&gt;N&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;Y&lt;/td&gt;
      &lt;td&gt;Y&lt;/td&gt;
      &lt;td&gt;Y&lt;/td&gt;
      &lt;td&gt;N&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;2&lt;/td&gt;
      &lt;td&gt;N&lt;/td&gt;
      &lt;td&gt;Y&lt;/td&gt;
      &lt;td&gt;Y&lt;/td&gt;
      &lt;td&gt;N&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;3&lt;/td&gt;
      &lt;td&gt;N&lt;/td&gt;
      &lt;td&gt;N&lt;/td&gt;
      &lt;td&gt;N&lt;/td&gt;
      &lt;td&gt;Y&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;interpretation&quot;&gt;Interpretation&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Students are labeled &lt;strong&gt;0, 1, 2, 3&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;Each row/column pair indicates whether two students are connected&lt;/li&gt;
  &lt;li&gt;Example: In row 0, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot;YYNN&quot;&lt;/code&gt; means:
    &lt;ul&gt;
      &lt;li&gt;0–0 → ignore (self)&lt;/li&gt;
      &lt;li&gt;0–1 → connected&lt;/li&gt;
      &lt;li&gt;0–2 → not connected&lt;/li&gt;
      &lt;li&gt;0–3 → not connected&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;goal&quot;&gt;Goal&lt;/h3&gt;

&lt;p&gt;Find the number of &lt;strong&gt;connected components&lt;/strong&gt; in this graph, where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&apos;Y&apos;&lt;/code&gt; represents an edge.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;constraints&quot;&gt;Constraints&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Time Complexity:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O(N²)&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Space Complexity:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O(N)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/Z4C5VYEJD8o?si=3T__qCpZQ2OWHlHL&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;Interpretation of edges&lt;/p&gt;

&lt;p&gt;0 ↔ 1&lt;/p&gt;

&lt;p&gt;1 ↔ 2&lt;/p&gt;

&lt;p&gt;3 is only connected to itself (ignore self‑loops)&lt;/p&gt;

&lt;p&gt;Graph: &lt;br /&gt;
   (0) —– (1) —– (2)&lt;/p&gt;

&lt;p&gt;(3)&lt;/p&gt;

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

&lt;p&gt;Students 0, 1, and 2 form one connected component (a friend circle).&lt;/p&gt;

&lt;p&gt;Student 3 is isolated and forms its own friend circle.&lt;/p&gt;

&lt;p&gt;So the graph has 2 friend circles.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;java&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;friendCircles&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;];&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;dfs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++;&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;dfs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;student&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;student&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;connectedStudents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;student&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;connectedStudents&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connectedStudents&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;charAt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;sc&quot;&gt;&apos;Y&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;student&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;dfs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;



&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;python&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;friend_circles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;dfs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;student&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;student&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;student&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Y&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;student&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
                &lt;span class=&quot;nf&quot;&gt;dfs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;visited&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt;
            &lt;span class=&quot;nf&quot;&gt;dfs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;YYNN&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;YYYN&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;NYYN&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;NNNY&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;nf&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;friend_circles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;friends&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# Output: 2
&lt;/span&gt;


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

&lt;p&gt;&lt;strong&gt;Time Complexity:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O(N²)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Space Complexity:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O(N)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/miqbal3636/problem_solving/blob/main/src/com/spsoft/interview/medium/FindingFriendCircles.java&quot;&gt;Github - Finding Friend Circles&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author: Mohammad J Iqbal&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/profile.jpg&quot; loading=&quot;lazy&quot; alt=&quot;Mohammad J Iqbal&quot; style=&quot;width:100px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&amp;amp;followMember=miqbal2&quot;&gt;Follow Mohammad J Iqbal on LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Thu, 25 Dec 2025 00:00:00 -0500</pubDate>
        <link>https://spring-soft.com//coding_problems/2025/12/25/finding_friend_circles.html</link>
        <guid isPermaLink="true">https://spring-soft.com//coding_problems/2025/12/25/finding_friend_circles.html</guid>
      </item>
    
      <item>
        <title>What Is a Microservice and Why It Matters in Modern Software Architecture</title>
        <description>&lt;p&gt;In today’s fast-paced tech landscape, building scalable, maintainable applications is no longer optional—it’s essential. That’s where &lt;strong&gt;microservices&lt;/strong&gt; come in. If you’ve ever struggled with bloated monolithic codebases or deployment bottlenecks, this post is for you.&lt;/p&gt;

&lt;p&gt;We’ll break down what microservices are, why they’ve become so popular, and how they’re transforming the way we build software—with a special focus on Spring Boot.&lt;/p&gt;

&lt;h2 id=&quot;-the-monolith-problem&quot;&gt;🧱 The Monolith Problem&lt;/h2&gt;

&lt;p&gt;Traditional applications are often built as &lt;strong&gt;monoliths&lt;/strong&gt;—a single, unified codebase where all features are tightly coupled. While this approach is simple to start with, it quickly becomes a nightmare as the app grows:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;One bug can crash the entire system&lt;/li&gt;
  &lt;li&gt;Scaling requires duplicating the whole app&lt;/li&gt;
  &lt;li&gt;Deployments are slow and risky&lt;/li&gt;
  &lt;li&gt;Teams are blocked by dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sound familiar? That’s why companies are moving toward microservices.&lt;/p&gt;

&lt;h2 id=&quot;-what-is-a-microservice&quot;&gt;🧩 What Is a Microservice?&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;microservice&lt;/strong&gt; is a small, independent service that performs a specific business function. Think of it as a self-contained module that:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Runs in its own process&lt;/li&gt;
  &lt;li&gt;Has its own database&lt;/li&gt;
  &lt;li&gt;Communicates with other services via APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, in an e-commerce app, you might have separate microservices for:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;User authentication&lt;/li&gt;
  &lt;li&gt;Product catalog&lt;/li&gt;
  &lt;li&gt;Order processing&lt;/li&gt;
  &lt;li&gt;Payment gateway&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each service can be developed, deployed, and scaled independently.&lt;/p&gt;

&lt;h2 id=&quot;-why-microservices-why-now&quot;&gt;🚀 Why Microservices, Why Now?&lt;/h2&gt;

&lt;p&gt;Microservices have gained traction because they solve real-world problems:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: You can scale only the services that need it&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resilience&lt;/strong&gt;: A failure in one service doesn’t crash the whole system&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Agility&lt;/strong&gt;: Teams can work in parallel and deploy faster&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;: Different services can use different tech stacks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With the rise of &lt;strong&gt;cloud computing&lt;/strong&gt;, &lt;strong&gt;Docker&lt;/strong&gt;, and &lt;strong&gt;Kubernetes&lt;/strong&gt;, microservices are easier to manage than ever. And frameworks like &lt;strong&gt;Spring Boot&lt;/strong&gt; make building them fast and intuitive.&lt;/p&gt;

&lt;h2 id=&quot;️-pros-and-cons-of-microservice&quot;&gt;⚖️ Pros and Cons of microservice&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;✅ Pros&lt;/th&gt;
      &lt;th&gt;⚠️ Cons&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Independent deployment&lt;/td&gt;
      &lt;td&gt;Complex inter-service communication&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Fault isolation&lt;/td&gt;
      &lt;td&gt;Requires DevOps maturity&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Tech stack flexibility&lt;/td&gt;
      &lt;td&gt;Distributed debugging&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Easier scaling&lt;/td&gt;
      &lt;td&gt;Higher initial setup cost&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Microservices aren’t a silver bullet—but when done right, they offer a powerful way to build modern, cloud-native applications.&lt;/p&gt;

&lt;h2 id=&quot;-next-steps&quot;&gt;🔗 Next Steps&lt;/h2&gt;

&lt;p&gt;Now that you understand the “what” and “why,” it’s time to build. Head over to our tutorial:&lt;br /&gt;
👉 &lt;a href=&quot;https://spring-soft.com/spring/2025/09/07/kickstarting-microservices.html&quot;&gt;Kickstarting Microservices with Spring Boot&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’ll walk you through creating your first Spring Boot microservice, step by step.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;— Mohammad, Founder of Spring-Soft&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/profile.jpg&quot; loading=&quot;lazy&quot; alt=&quot;Mohammad J Iqbal&quot; style=&quot;width:100px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&amp;amp;followMember=miqbal2&quot;&gt;Follow Mohammad J Iqbal on LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Sun, 30 Nov 2025 00:00:00 -0500</pubDate>
        <link>https://spring-soft.com//spring/2025/11/30/what-is-a-microservice.html</link>
        <guid isPermaLink="true">https://spring-soft.com//spring/2025/11/30/what-is-a-microservice.html</guid>
      </item>
    
      <item>
        <title>Kickstarting Microservices with Spring Boot: A New Chapter at Spring-Soft</title>
        <description>&lt;p&gt;Welcome to a new era at &lt;strong&gt;Spring-Soft&lt;/strong&gt;—where clean code meets scalable architecture. If you’ve been following our journey, you know we’re passionate about building robust, maintainable software. Today, we’re thrilled to introduce a brand-new content series focused on &lt;strong&gt;Spring Boot Microservices&lt;/strong&gt;—a modern approach to designing enterprise-grade applications that are modular, resilient, and cloud-ready.&lt;/p&gt;

&lt;h2 id=&quot;-why-microservices-why-now&quot;&gt;🌱 Why Microservices, Why Now?&lt;/h2&gt;

&lt;p&gt;Monolithic applications served us well for years, but as systems grow, they become harder to scale, maintain, and deploy. Microservices solve this by breaking down applications into smaller, independent services that communicate over lightweight protocols.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Spring Boot&lt;/strong&gt;, developers get a powerful toolkit to build microservices quickly and efficiently:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Embedded servers (Tomcat, Jetty) for easy deployment&lt;/li&gt;
  &lt;li&gt;Auto-configuration and starter dependencies&lt;/li&gt;
  &lt;li&gt;Seamless integration with Spring Cloud for distributed systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you’re a seasoned Java developer or just stepping into backend architecture, this series will guide you through the entire journey—from concept to production.&lt;/p&gt;

&lt;h2 id=&quot;-what-you-can-expect&quot;&gt;📚 What You Can Expect&lt;/h2&gt;

&lt;p&gt;Over the coming weeks, we’ll publish tutorials, walkthroughs, and real-world examples covering topics like:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;What Is a Microservice and Why It Matters in Modern Software Architecture&lt;/li&gt;
  &lt;li&gt;Building your first microservice with Spring Boot&lt;/li&gt;
  &lt;li&gt;Service discovery using &lt;strong&gt;Eureka&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;API Gateway setup with &lt;strong&gt;Spring Cloud Gateway&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;Inter-service communication with &lt;strong&gt;REST&lt;/strong&gt;, &lt;strong&gt;Kafka&lt;/strong&gt;, and &lt;strong&gt;RabbitMQ&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;Securing services with &lt;strong&gt;OAuth2&lt;/strong&gt; and &lt;strong&gt;Keycloak&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;Dockerizing and deploying to &lt;strong&gt;Kubernetes&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each blog post will be paired with a &lt;strong&gt;YouTube video&lt;/strong&gt; on our channel &lt;a href=&quot;https://www.youtube.com/@code_design&quot;&gt;&lt;em&gt;code_design&lt;/em&gt;&lt;/a&gt; to give you hands-on guidance and visual walkthroughs.&lt;/p&gt;

&lt;h2 id=&quot;-who-this-is-for&quot;&gt;🎯 Who This Is For&lt;/h2&gt;

&lt;p&gt;This series is crafted for:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Java developers looking to transition into microservices&lt;/li&gt;
  &lt;li&gt;Architects exploring scalable system design&lt;/li&gt;
  &lt;li&gt;Students and tech enthusiasts eager to build modern apps&lt;/li&gt;
  &lt;li&gt;Anyone who loves clean code and smart design&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;-stay-tuned&quot;&gt;🔔 Stay Tuned&lt;/h2&gt;

&lt;p&gt;Our first tutorial—&lt;strong&gt;“Creating Your First Spring Boot Microservice”&lt;/strong&gt;—drops next week. Follow my LinkedIn or our YouTube channel to stay updated. We promise to keep things practical, beginner-friendly, and production-focused.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Ready to break the monolith? Let’s build something scalable together.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;— Mohammad, Founder of Spring-Soft&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/profile.jpg&quot; loading=&quot;lazy&quot; alt=&quot;Mohammad J Iqbal&quot; style=&quot;width:100px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&amp;amp;followMember=miqbal2&quot;&gt;Follow Mohammad J Iqbal on LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Sun, 07 Sep 2025 00:00:00 -0400</pubDate>
        <link>https://spring-soft.com//spring/2025/09/07/kickstarting-microservices.html</link>
        <guid isPermaLink="true">https://spring-soft.com//spring/2025/09/07/kickstarting-microservices.html</guid>
      </item>
    
      <item>
        <title>Java 17 Random Generation Improvement</title>
        <description>&lt;p&gt;In &lt;strong&gt;Java 17&lt;/strong&gt;, the new &lt;strong&gt;RandomGenerator API&lt;/strong&gt; was introduced to enhance the flexibility, efficiency, and variety of random number generation. Here’s how it improves upon previous random generation methods:&lt;/p&gt;

&lt;h3 id=&quot;improvements-over-javautilrandom&quot;&gt;&lt;strong&gt;Improvements over &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;java.util.Random&lt;/code&gt;&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Previously, Java provided the basic &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Random&lt;/code&gt; class for generating random numbers, but:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;It lacked advanced algorithms for different use cases.&lt;/li&gt;
  &lt;li&gt;Developers had limited control over random number distributions.&lt;/li&gt;
  &lt;li&gt;There were no standardized interfaces for different random algorithms.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;key-enhancements-in-java-17s-random-generator-api&quot;&gt;&lt;strong&gt;Key Enhancements in Java 17’s Random Generator API&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Multiple Random Number Algorithms&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Java 17 introduces several algorithms like:
        &lt;ul&gt;
          &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;L32X64MixRandom&lt;/code&gt;&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;L128X128MixRandom&lt;/code&gt;&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;L128X256MixRandom&lt;/code&gt;&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Xoshiro256PlusPlus&lt;/code&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;These offer different trade-offs in speed, unpredictability, and performance.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Unified Interface&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;The new &lt;strong&gt;RandomGenerator&lt;/strong&gt; interface allows developers to work with different random algorithms seamlessly:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;RandomGenerator&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rng&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;RandomGenerator&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;L128X256MixRandom&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rng&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;nextInt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;This makes it easy to swap out different random generation strategies without changing much code.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Better Performance &amp;amp; Efficiency&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Some algorithms are &lt;strong&gt;optimized for concurrency&lt;/strong&gt;, meaning they work better in multi-threaded environments.&lt;/li&gt;
      &lt;li&gt;They can be selected based on specific needs, such as cryptographic security, simulation, or statistical randomness.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Thread-Safe Implementations&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Java 17 improves &lt;strong&gt;parallel random number generation&lt;/strong&gt;, reducing contention in multi-threaded applications.&lt;/li&gt;
      &lt;li&gt;Some generators are designed for &lt;strong&gt;fast, scalable random number creation&lt;/strong&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Stream-Based Random Number Generation&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Supports new methods that allow random numbers to be generated as streams:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;rng&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ints&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;Helps work seamlessly with Java’s functional programming style.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;why-its-important&quot;&gt;&lt;strong&gt;Why It’s Important&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;The new API standardizes random number generation, making it more &lt;strong&gt;efficient, flexible, and adaptable&lt;/strong&gt; for developers. Instead of relying solely on the outdated &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Random&lt;/code&gt; class, developers can now choose the best &lt;strong&gt;random number algorithm&lt;/strong&gt; for their specific use case.&lt;/p&gt;
</description>
        <pubDate>Sun, 25 May 2025 00:00:00 -0400</pubDate>
        <link>https://spring-soft.com//java_concepts/2025/05/25/java17-random-generation-improvement.html</link>
        <guid isPermaLink="true">https://spring-soft.com//java_concepts/2025/05/25/java17-random-generation-improvement.html</guid>
      </item>
    
      <item>
        <title>Java 24 Features</title>
        <description>&lt;h3 id=&quot;java-24-features-released-march-2025&quot;&gt;&lt;strong&gt;Java 24 Features (Released March 2025)&lt;/strong&gt;&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Primitive Types in Patterns (Second Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;This feature enhances pattern matching by allowing primitive types in all pattern contexts, including instanceof and switch.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Module Import Declarations (Second Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Allows importing all packages exported by a module in a more concise way.&lt;/li&gt;
      &lt;li&gt;Simplifies modular library reuse.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Flexible Constructor Bodies (Third Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Enables statements to appear &lt;strong&gt;before&lt;/strong&gt; an explicit constructor invocation (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;super(...)&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;this(...)&lt;/code&gt;).&lt;/li&gt;
      &lt;li&gt;Improves reliability when initializing fields before calling another constructor.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Simple Source Files &amp;amp; Instance Main Methods(Fourth Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Makes it easier for beginners to write Java programs without needing complex class structures.&lt;/li&gt;
      &lt;li&gt;Helps experienced developers write small programs more succinctly.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Quantum-Resistant Cryptography&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Introduces &lt;strong&gt;quantum-resistant digital signature algorithms&lt;/strong&gt; to enhance security.&lt;/li&gt;
      &lt;li&gt;Helps protect against future quantum computing threats.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Ahead-of-Time Class Loading &amp;amp; Linking [JEP 483]&lt;/strong&gt;&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;Improves startup time by making the classes of an application instantly available, in a loaded and linked state, when the HotSpot Java Virtual Machine starts. Achieve this by monitoring the application during one run and storing the loaded and linked forms of all classes in a cache for use in subsequent runs. Lay a foundation for future improvements to both startup and warmup time.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Generational Shenandoah Garbage Collector&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Improves memory management efficiency by introducing &lt;strong&gt;generational GC&lt;/strong&gt; for Shenandoah.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Stream Gatherers&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Adds new methods to &lt;strong&gt;Stream API&lt;/strong&gt; for more flexible data processing.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Vector API Enhancements&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Improves performance for mathematical computations using &lt;strong&gt;vectorized operations&lt;/strong&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Expanded AI Support&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Enhancements in &lt;strong&gt;pattern matching&lt;/strong&gt; and &lt;strong&gt;module imports&lt;/strong&gt; make Java more suitable for AI-powered applications.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java 24 is packed with improvements across &lt;strong&gt;performance, security, concurrency, and AI integration&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To learn more, you can check out the full details 
&lt;a href=&quot;https://blogs.oracle.com/java/post/the-arrival-of-java-24&quot;&gt;here&lt;/a&gt; or
&lt;a href=&quot;https://docs.oracle.com/en/java/javase/24/migrate/significant-changes-jdk-24.html&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
        <pubDate>Sat, 24 May 2025 00:00:00 -0400</pubDate>
        <link>https://spring-soft.com//java_concepts/2025/05/24/java24.html</link>
        <guid isPermaLink="true">https://spring-soft.com//java_concepts/2025/05/24/java24.html</guid>
      </item>
    
      <item>
        <title>Java 22 and Java 23 Features</title>
        <description>&lt;p&gt;Java 22 and Java 23 continue the trend of refining existing features while introducing new enhancements focused on performance, developer productivity, and modern language improvements.&lt;/p&gt;

&lt;h3 id=&quot;java-22-features-released-march-2024&quot;&gt;&lt;strong&gt;Java 22 Features (Released March 2024)&lt;/strong&gt;&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;String Templates (Second Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Expands on the preview from Java 21.&lt;/li&gt;
      &lt;li&gt;Allows embedding expressions directly inside strings.
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Java&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;greeting&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;STR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Hello, \{name} 22!&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Scoped Values (Second Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Improves efficiency in sharing immutable data between threads.&lt;/li&gt;
      &lt;li&gt;More optimized compared to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ThreadLocal&lt;/code&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Vector API (Sixth Incubator)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Enhanced support for mathematical computations using vectorization.&lt;/li&gt;
      &lt;li&gt;Helps improve performance in data processing applications.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Foreign Function &amp;amp; Memory API (Finalized)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;This API is now a stable feature.&lt;/li&gt;
      &lt;li&gt;Provides efficient interoperability with native code.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Pattern Matching for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt; (Finalized)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;The feature that started as a preview is now officially part of Java.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;java-23-features-released-september-2024&quot;&gt;&lt;strong&gt;Java 23 Features (Released September 2024)&lt;/strong&gt;&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Primitive Types in Patterns (Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Expands pattern matching capabilities to include primitive types.&lt;/li&gt;
      &lt;li&gt;Enhances &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;instanceof&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt; statements for better performance.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Generational ZGC&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Improves memory management efficiency through a generational approach.&lt;/li&gt;
      &lt;li&gt;Enhances garbage collection performance for large-scale applications.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Expanded Virtual Threads Features&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Further refinements in concurrency management.&lt;/li&gt;
      &lt;li&gt;Improving performance and debugging tools.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Markdown Documentation Comments&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Introduces native Markdown support for Java documentation.&lt;/li&gt;
      &lt;li&gt;Allows better formatting and readability in Javadoc comments.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Class-File API (Second Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Enables advanced manipulation of Java class files.&lt;/li&gt;
      &lt;li&gt;Useful for tools and frameworks that interact with bytecode.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Performance Boost for JVM&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Includes enhancements to runtime efficiency.&lt;/li&gt;
      &lt;li&gt;The &lt;strong&gt;Graal JIT Compiler&lt;/strong&gt; further optimizes performance.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;looking-ahead&quot;&gt;&lt;strong&gt;Looking Ahead&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Java 22 stabilized many features previewed in Java 21, while Java 23 refines &lt;strong&gt;concurrency, memory management, and modern syntax improvements&lt;/strong&gt;. These releases set the stage for Java’s continued evolution toward better efficiency and developer experience.&lt;/p&gt;

&lt;hr /&gt;
</description>
        <pubDate>Fri, 23 May 2025 00:00:00 -0400</pubDate>
        <link>https://spring-soft.com//java_concepts/2025/05/23/java22-java23.html</link>
        <guid isPermaLink="true">https://spring-soft.com//java_concepts/2025/05/23/java22-java23.html</guid>
      </item>
    
      <item>
        <title>Java 21 features</title>
        <description>&lt;p&gt;&lt;strong&gt;Java 21&lt;/strong&gt; is a &lt;strong&gt;long-term support (LTS) release&lt;/strong&gt;, meaning it will receive extended support and updates. This version builds upon the experimental features of previous releases and brings several refinements. Here are the key enhancements:&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;java-21-features-released-september-2023&quot;&gt;&lt;strong&gt;Java 21 Features (Released September 2023)&lt;/strong&gt;&lt;/h3&gt;

&lt;h4 id=&quot;1-virtual-threads-final&quot;&gt;1. &lt;strong&gt;Virtual Threads (Final)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Provides lightweight threads for efficient concurrency management.&lt;/li&gt;
  &lt;li&gt;Reduces overhead compared to traditional platform threads.
    &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;   &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;executor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Executors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newVirtualThreadPerTaskExecutor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;executor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Running in a virtual thread&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;2-structured-concurrency-preview&quot;&gt;2. &lt;strong&gt;Structured Concurrency (Preview)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Simplifies parallel programming and thread management.&lt;/li&gt;
  &lt;li&gt;Ensures tasks are completed reliably, reducing concurrency bugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;3-pattern-matching-for-switch-final&quot;&gt;3. &lt;strong&gt;Pattern Matching for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt; (Final)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Allows more expressive type matching in switch statements.
    &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;   &lt;span class=&quot;k&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;String: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Integer&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Integer: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Unknown type&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;4-scoped-values-preview&quot;&gt;4. &lt;strong&gt;Scoped Values (Preview)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Provides an efficient way for threads to share data.&lt;/li&gt;
  &lt;li&gt;Helps avoid reliance on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ThreadLocal&lt;/code&gt; storage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;5-foreign-function--memory-api-final&quot;&gt;5. &lt;strong&gt;Foreign Function &amp;amp; Memory API (Final)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Allows Java programs to interact with native libraries without JNI.&lt;/li&gt;
  &lt;li&gt;Improves interoperability with external systems.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;6-sequenced-collections&quot;&gt;6. &lt;strong&gt;Sequenced Collections&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Introduces &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SequencedCollection&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SequencedSet&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SequencedMap&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Standardizes methods like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reverse()&lt;/code&gt; for collections.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;7-string-templates-preview&quot;&gt;7. &lt;strong&gt;String Templates (Preview)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Allows inline expressions inside strings, similar to other language using The STR Template Processor
 The STR Template Processor performs string interpolation by iteratively replacing each embedded expression of the provided template with the stringified value of that expression. Below We’ll have an example of STR processor String template:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;   &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Java&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;message&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;STR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Welcome to \{name} 21!&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h4 id=&quot;8-performance-and-security-improvements&quot;&gt;8. &lt;strong&gt;Performance and Security Improvements&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;General optimizations for JVM efficiency.&lt;/li&gt;
  &lt;li&gt;Enhanced security measures for safer execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;why-java-21-matters&quot;&gt;&lt;strong&gt;Why Java 21 Matters&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Being an &lt;strong&gt;LTS&lt;/strong&gt; version, Java 21 is expected to be widely adopted by enterprises and long-term projects. It finalizes key features such as &lt;strong&gt;virtual threads, pattern matching, and foreign function API&lt;/strong&gt;, making Java more modern and developer-friendly.&lt;/p&gt;
</description>
        <pubDate>Tue, 20 May 2025 00:00:00 -0400</pubDate>
        <link>https://spring-soft.com//java_concepts/2025/05/20/java21.html</link>
        <guid isPermaLink="true">https://spring-soft.com//java_concepts/2025/05/20/java21.html</guid>
      </item>
    
      <item>
        <title>Java 18 to Java 20 features</title>
        <description>&lt;p&gt;Java 18 to Java 20 introduced several enhancements focused on performance, developer productivity, and new language features. Let’s go through each version:&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;java-18-features-released-march-2022&quot;&gt;&lt;strong&gt;Java 18 Features (Released March 2022)&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Java 18 was a relatively small update but introduced useful enhancements:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;UTF-8 as Default Charset&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Java now defaults to UTF-8 for encoding text across different platforms.&lt;/li&gt;
      &lt;li&gt;Helps ensure consistency when handling text files globally.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Simple Web Server&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Introduced a built-in lightweight web server useful for development/testing:
        &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jwebserver &lt;span class=&quot;nt&quot;&gt;--port&lt;/span&gt; 8080
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;No need for third-party tools for basic testing.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Code Snippets in Java API Documentation&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Enhances Javadoc by allowing structured code snippets for better documentation.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Vector API (Third Incubator)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Improved vector computation support, optimizing performance for mathematical operations.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;java-19-features-released-september-2022&quot;&gt;&lt;strong&gt;Java 19 Features (Released September 2022)&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Java 19 introduced &lt;strong&gt;preview&lt;/strong&gt; and &lt;strong&gt;incubating&lt;/strong&gt; features paving the way for future improvements:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Virtual Threads (Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Provides lightweight, high-performance threads for concurrent programming.&lt;/li&gt;
      &lt;li&gt;Significantly reduces thread management overhead:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;executor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Executors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newVirtualThreadPerTaskExecutor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;executor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Hello from Virtual Thread!&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Structured Concurrency (Incubator)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Helps simplify multi-threaded applications with better lifecycle management.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Foreign Function &amp;amp; Memory API (Second Incubator)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Allows Java to interact efficiently with native libraries without JNI.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Pattern Matching for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt; (Third Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Enhances pattern matching by allowing type-based case handling.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Linux-RISC-V Port&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Introduces official support for the &lt;strong&gt;RISC-V&lt;/strong&gt; architecture in Java.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;java-20-features-released-march-2023&quot;&gt;&lt;strong&gt;Java 20 Features (Released March 2023)&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Java 20 built upon Java 19’s &lt;strong&gt;preview&lt;/strong&gt; features with refinements:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Virtual Threads (Second Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;More improvements to make virtual threads production-ready.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Scoped Values (Incubator)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Optimizes data sharing between threads without relying on thread-local storage.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Structured Concurrency (Second Incubator)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Enhances parallel programming models, making multi-threading safer.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Pattern Matching for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt; (Fourth Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Extends pattern matching capabilities with richer case handling.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Foreign Function &amp;amp; Memory API (Third Incubator)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Brings it closer to becoming a standard feature in Java.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;p&gt;Java 18 to 20 focused on &lt;strong&gt;performance improvements, virtual threads, enhanced concurrency, and foreign memory interactions&lt;/strong&gt;. Java is steadily evolving toward better parallel execution and native interoperability.&lt;/p&gt;
</description>
        <pubDate>Mon, 05 May 2025 00:00:00 -0400</pubDate>
        <link>https://spring-soft.com//java_concepts/2025/05/05/java18-to-java-20.html</link>
        <guid isPermaLink="true">https://spring-soft.com//java_concepts/2025/05/05/java18-to-java-20.html</guid>
      </item>
    
      <item>
        <title>Java 17 features</title>
        <description>&lt;p&gt;Java 17 is a &lt;strong&gt;long-term support (LTS) release&lt;/strong&gt;, meaning it will receive updates and support for an extended period. It introduced several enhancements aimed at improving performance, security, and productivity. Here are the key features:&lt;/p&gt;

&lt;h3 id=&quot;java-17-features-released-september-2021&quot;&gt;&lt;strong&gt;Java 17 Features (Released September 2021)&lt;/strong&gt;&lt;/h3&gt;

&lt;h4 id=&quot;1-sealed-classes-final&quot;&gt;1. &lt;strong&gt;Sealed Classes (Final)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Restricts which classes can inherit from a superclass.&lt;/li&gt;
  &lt;li&gt;Helps enforce better design patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;   
   &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sealed&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Animal&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;permits&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Dog&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt;
   
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;2-pattern-matching-for-switch-preview&quot;&gt;2. &lt;strong&gt;Pattern Matching for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt; (Preview)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Allows pattern matching within switch expressions.&lt;/li&gt;
  &lt;li&gt;Makes code more concise and readable.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;   
      &lt;span class=&quot;k&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
       &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Integer&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Integer: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
       &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;String: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
       &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Unknown type&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
   
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;3-new-macos-rendering-pipeline&quot;&gt;3. &lt;strong&gt;New macOS Rendering Pipeline&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Uses &lt;strong&gt;Metal API&lt;/strong&gt; instead of the outdated OpenGL.&lt;/li&gt;
  &lt;li&gt;Improves graphical performance for macOS applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;4-removal-of-deprecated-features&quot;&gt;4. &lt;strong&gt;Removal of Deprecated Features&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Eliminated &lt;strong&gt;Applet API&lt;/strong&gt;, which was outdated.&lt;/li&gt;
  &lt;li&gt;Removed &lt;strong&gt;Security Manager&lt;/strong&gt;, simplifying security handling.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;5-foreign-function--memory-api-incubating&quot;&gt;5. &lt;strong&gt;Foreign Function &amp;amp; Memory API (Incubating)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Helps Java interact with native libraries without JNI.&lt;/li&gt;
  &lt;li&gt;Improves interoperability with external code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;6-new-randomgenerator-api&quot;&gt;6. &lt;strong&gt;New &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RandomGenerator&lt;/code&gt; API&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Provides improved and flexible random number generation.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;   &lt;span class=&quot;nc&quot;&gt;RandomGenerator&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rng&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;RandomGenerator&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;L128X256MixRandom&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rng&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;nextInt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
   
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Java 17 solidifies many preview features from previous versions and sets the stage for modern Java development. It’s particularly valuable for enterprise applications due to its &lt;strong&gt;LTS&lt;/strong&gt; status.&lt;/p&gt;
</description>
        <pubDate>Sun, 04 May 2025 00:00:00 -0400</pubDate>
        <link>https://spring-soft.com//java_concepts/2025/05/04/java17.html</link>
        <guid isPermaLink="true">https://spring-soft.com//java_concepts/2025/05/04/java17.html</guid>
      </item>
    
      <item>
        <title>Java 12 to Java 16 features</title>
        <description>&lt;p&gt;Java 12 to Java 16 brought steady improvements, refining features and introducing new enhancements. Let’s break it down:&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;java-12-features-released-march-2019&quot;&gt;&lt;strong&gt;Java 12 Features (Released March 2019)&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Switch Expressions (Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Allowed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt; to return a value in a more concise way:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;day&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;MONDAY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FRIDAY&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Busy day!&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;SATURDAY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;SUNDAY&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Weekend!&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Regular day.&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;Improves readability and eliminates repetitive &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;break&lt;/code&gt; statements.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Improved Garbage Collection&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Introduced &lt;strong&gt;Shenandoah GC&lt;/strong&gt;, reducing pause times for large heaps.&lt;/li&gt;
      &lt;li&gt;Enhanced performance in memory management.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Compact Number Formatting&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Helps format numbers in a human-readable way:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;NumberFormat&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;formatter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;NumberFormat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getCompactNumberInstance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Locale&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;US&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;NumberFormat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;SHORT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;formatter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Outputs &quot;1K&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
        &lt;hr /&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;java-13-features-released-september-2019&quot;&gt;&lt;strong&gt;Java 13 Features (Released September 2019)&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Text Blocks (Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Enables easier multiline string handling:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;json&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&quot;&quot;&quot;
    {
        &quot;name&quot;: &quot;Java&quot;,
        &quot;version&quot;: 13
    }
    &quot;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;Improves readability and reduces escape sequences.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Enhancements to Switch Expressions&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Further refinement of &lt;strong&gt;switch case&lt;/strong&gt; for clearer structure.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;java-14-features-released-march-2020&quot;&gt;&lt;strong&gt;Java 14 Features (Released March 2020)&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Records (Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Introduced a simpler way to create immutable data carriers:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;record&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;Reduces boilerplate code in POJOs.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Pattern Matching for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;instanceof&lt;/code&gt; (Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Eliminates redundant casting:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Helpful NullPointerException Messages&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Improves debugging by clearly indicating what was &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;null&lt;/code&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;java-15-features-released-september-2020&quot;&gt;&lt;strong&gt;Java 15 Features (Released September 2020)&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Text Blocks (Final)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Multiline strings were finalized after previews in Java 13 &amp;amp; 14.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Sealed Classes (Preview)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Restricts inheritance to specific subclasses:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sealed&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Animal&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;permits&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Dog&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Hidden Classes&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Allows creating runtime classes that aren’t visible outside their defining class loader.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;java-16-features-released-march-2021&quot;&gt;&lt;strong&gt;Java 16 Features (Released March 2021)&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Records (Final)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Records became a permanent part of Java.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Pattern Matching for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;instanceof&lt;/code&gt; (Final)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Officially part of the language after preview versions.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Improved Stream API&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Added &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;toList()&lt;/code&gt; method for easier list conversion:
        &lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;Stream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stream&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Stream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;A&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;B&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;C&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
        &lt;hr /&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java 12 to 16 focused on refining usability, improving syntax, and optimizing performance.&lt;/p&gt;
</description>
        <pubDate>Sat, 03 May 2025 00:00:00 -0400</pubDate>
        <link>https://spring-soft.com//java_concepts/2025/05/03/java12-to-java16.html</link>
        <guid isPermaLink="true">https://spring-soft.com//java_concepts/2025/05/03/java12-to-java16.html</guid>
      </item>
    
  </channel>
</rss>