<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aman Verma on Medium]]></title>
        <description><![CDATA[Stories by Aman Verma on Medium]]></description>
        <link>https://medium.com/@amn24?source=rss-3f5e238209ea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8VPrguZD6t2ClFjFLANpgw.png</url>
            <title>Stories by Aman Verma on Medium</title>
            <link>https://medium.com/@amn24?source=rss-3f5e238209ea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:16:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amn24/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SQL_Sheet]]></title>
            <link>https://amn24.medium.com/sql-sheet-59d0386c335d?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/59d0386c335d</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[technoogy]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Fri, 16 Oct 2026 06:13:54 GMT</pubDate>
            <atom:updated>2026-10-16T06:13:54.792Z</atom:updated>
            <content:encoded><![CDATA[<pre>SQL&gt; select * from emp;<br><br>     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO<br>---------- ---------- --------- ---------- --------- ---------- ---------- ----------<br>      7369 SMITH      CLERK           7902 17-DEC-80        800           20<br>      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30<br>      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30<br>      7566 JONES      MANAGER         7839 02-APR-81       2975           20<br>      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30<br>      7698 BLAKE      MANAGER         7839 01-MAY-81       2850           30<br>      7782 CLARK      MANAGER         7839 09-JUN-81       2450           10<br>      7788 SCOTT      ANALYST         7566 09-DEC-82       3000           20<br>      7839 KING       PRESIDENT            17-NOV-81       5000           10<br>      7844 TURNER     SALESMAN        7698 08-SEP-81       1500         0          30<br>      7876 ADAMS      CLERK           7788 12-JAN-83       1100           20<br>      7900 JAMES      CLERK           7698 03-DEC-81        950           30<br>      7902 FORD       ANALYST         7566 03-DEC-81       3000           20<br>      7934 MILLER     CLERK           7782 23-JAN-82       1300           10</pre><h3>Part 1: Basic Retrieval and Filtering</h3><p>No. Question SQL Concept</p><p>1 Display all columns from EMP. SELECT *</p><p>2 Display only ENAME and SAL. Column selection</p><p>3 Display employees whose salary is greater than 2000. WHERE, &gt;</p><p>4 Display employees working in department 20. WHERE, =</p><p>5 Display employees whose job is CLERK. WHERE, text filtering 6 Display employees whose salary is less than or equal to 1500. &lt;=</p><h3>Part 2: DISTINCT, AND, OR and NOT</h3><p>No. Question SQL Concept</p><p>1 Display all unique job names. DISTINCT</p><p>2 Display employees working in department 10 or 20. OR</p><p>3 Display employees whose salary is greater than 1000 and less than 3000. AND</p><p>4 Display employees who are not managers. NOT / &lt;&gt;</p><p>5 Display employees in department 30 whose salary is greater than 1400. Multiple conditions</p><p>6 Display employees whose job is CLERK or ANALYST. OR</p><h3>Part 3: BETWEEN, IN, LIKE and NULL</h3><p>No. Question SQL Concept</p><p>1 Display employees whose salary is between 1000 and 3000, inclusive. BETWEEN</p><p>2 Display employees working in departments 10, 20 and 30. IN</p><p>3 Display employees whose names start with S. LIKE &#39;S%&#39;</p><p>4 Display employees whose names end with N. LIKE &#39;%N&#39;</p><p>5 Display employees whose names contain A. LIKE &#39;%A%&#39;</p><p>6 Display employees whose names have A as the second character. LIKE &#39;_A%&#39;</p><p>7 Display employees who receive commission (COMM IS NOT NULL). IS NOT NULL</p><p>8 Display employees who do not have commission recorded (COMM IS NULL). IS NULL</p><h3>Part 4: Sorting and Limiting Results</h3><p>No. Question SQL Concept</p><p>1 Display employees in ascending order of salary. ORDER BY ASC</p><p>2 Display employees in descending order of salary. ORDER BY DESC</p><p>3 Display employees alphabetically by name. ORDER BY ENAME</p><p>4 Display employees by department and salary in descending order. Multiple sort columns</p><p>5 Display the three highest-paid employees. FETCH FIRST</p><p>6 Display the five lowest-paid employees. FETCH FIRST</p><h3>Part 5: SQL Functions</h3><p>No. Question SQL Concept</p><p>1 Display employee names in uppercase. UPPER()</p><p>2 Display employee names in lowercase. LOWER()</p><p>3 Display the length of each employee&#39;s name. LENGTH()</p><p>4 Display the first three characters of each employee&#39;s name. SUBSTR()</p><p>5 Display salary increased by 500. Arithmetic expressions</p><p>6 Display annual salary, assuming salary is monthly. SAL * 12</p><p>7 Display salary rounded to the nearest hundred. ROUND()</p><p>8 Display hire dates in DD-MON-YYYY format. TO_CHAR()</p><p>9 Display commission as zero when it is NULL. NVL()</p><p>10 Display the current date. SYSDATE</p><h3>Part 6: Aggregate Functions, GROUP BY and HAVING</h3><p>No. Question SQL Concept</p><p>1 Count the total number of employees. COUNT(*)</p><p>2 Display the total salary of all employees. SUM()</p><p>3 Display the average salary. AVG()</p><p>4 Display the highest salary. MAX()</p><p>5 Display the lowest salary. MIN()</p><p>6 Count employees in each department. GROUP BY</p><p>7 Display average salary for each job. GROUP BY</p><p>8 Display departments having more than three employees. HAVING</p><p>9 Display jobs whose average salary is greater than 2000. GROUP BY, HAVING</p><p>10 Display departments where total salary exceeds 5000. SUM(), HAVING</p><h3>Part 7: SQL Joins</h3><p>Use the EMP and DEPT tables.</p><p>No. Practice question SQL concept</p><p>1 Display employee names with their department names. INNER JOIN</p><p>2 Display all employees, including those without a matching department. LEFT JOIN</p><p>3 Display all departments, including those without employees. RIGHT JOIN</p><p>4 Display all employees and departments, whether matched or not. FULL OUTER JOIN</p><p>5 Display employees working in the SALES department. Join with WHERE</p><p>6 Display employees and their department locations. Join multiple columns</p><p>7 Display employee names with their managers&#39; names. Self join</p><p>8 Count employees in each department, including departments with zero employees. LEFT JOIN, GROUP BY</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59d0386c335d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MultiThreading Revise]]></title>
            <link>https://amn24.medium.com/multithreading-revise-7a1d8979ca1b?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a1d8979ca1b</guid>
            <category><![CDATA[multithreading-in-java]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 12:54:57 GMT</pubDate>
            <atom:updated>2026-07-28T12:54:57.290Z</atom:updated>
            <content:encoded><![CDATA[<p>There are the following concepts that developers know very well, and Interview Questions asked in Companies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nBtIgnDKHDVavHndkaHXRA.jpeg" /></figure><p><strong><em>PART 1 — Thread Basics</em></strong></p><p><strong><em>PART 2 — Thread Life Cycle</em></strong></p><p><strong><em>PART 3 — Thread Priority &amp; Naming</em></strong></p><p><strong><em>PART 4 — Performing Multiple Tasks</em></strong></p><h3>🍽️ Story</h3><p>Imagine a restaurant.</p><ul><li>👨 <strong>One Waiter</strong> → Takes order → Serves food → Collects bill → Cleans table (One by one → Slow)</li><li>👨‍🍳👨‍🍳👨‍🍳 <strong>Multiple Waiters</strong> → Everyone works together (Fast)</li></ul><p>👉 <strong>Multithreading works exactly like multiple waiters.</strong></p><h3>PART 1 — Thread Basics</h3><h3>1. What is Multitasking?</h3><p><strong>Real Life</strong></p><ul><li>🎵 Listening to music</li><li>🌐 Browsing Chrome</li><li>💬 Using WhatsApp</li></ul><p>All together.</p><p><strong>Definition</strong></p><blockquote><em>Performing multiple tasks simultaneously.</em></blockquote><p><strong>In Java</strong></p><pre>Thread 1 → Download<br>Thread 2 → Music<br>Thread 3 → Print</pre><pre>2. Process vs Thread</pre><h3>Process</h3><p>An independent program.</p><p>Example:</p><ul><li>Chrome</li><li>VS Code</li><li>Spotify</li></ul><p>Each has <strong>its own memory</strong>.</p><h3>Thread</h3><p>A small task inside a process.</p><p>Example (Inside Chrome)</p><ul><li>Download</li><li>Open Tab</li><li>Play Video</li></ul><p>Threads <strong>share memory</strong>.</p><p>ProcessThreadHeavyLightweightSeparate MemoryShared MemorySlowFast</p><p><strong>Remember:</strong></p><blockquote><em>Process = Application</em></blockquote><blockquote><em>Thread = Worker inside the application</em></blockquote><h3>3. What is a Thread?</h3><p>A <strong>Thread</strong> is the <strong>smallest unit of execution</strong> inside a process.</p><p>Think of it as <strong>one worker</strong> doing one job.</p><h3>4. What is Multithreading?</h3><p>One application using <strong>multiple threads</strong> at the same time.</p><p>Example:</p><pre>Chrome<br>↓<br>Download<br>Watch YouTube<br>Browse<br>Play Music</pre><pre>Why Needed?</pre><ul><li>Faster execution</li><li>Better CPU utilization</li><li>Better user experience</li></ul><h3>5. Main Thread</h3><p>When Java starts,</p><p>✅ JVM automatically creates the <strong>Main Thread</strong>.</p><pre>JVM Starts<br>↓<br>Main Thread<br>↓<br>main()<br>↓<br>Child Threads</pre><pre>6. If Main Thread Ends?</pre><p>❌ Child threads do <strong>not</strong> stop.</p><p>They continue running unless they are <strong>Daemon Threads</strong>.</p><h3>7. Ways to Create a Thread</h3><h3>Method 1</h3><pre>class MyThread extends Thread</pre><pre>Method 2 (Recommended)</pre><pre>class MyTask implements Runnable</pre><pre>8. Thread vs Runnable</pre><h3>Thread</h3><ul><li>Easy</li><li>Cannot extend another class</li></ul><h3>Runnable</h3><ul><li>Flexible</li><li>Can extend another class</li><li>Recommended</li></ul><h3>PART 2 — Thread Life Cycle</h3><p>Think of a human.</p><pre>Born<br>↓<br>Ready<br>↓<br>Working<br>↓<br>Waiting<br>↓<br>Working<br>↓<br>Dead</pre><pre>Same for a thread.</pre><pre>NEW</pre><pre>↓</pre><pre>RUNNABLE</pre><pre>↓</pre><pre>RUNNING</pre><pre>↓</pre><pre>WAITING / BLOCKED</pre><pre>↓</pre><pre>TERMINATED</pre><pre>States</pre><ul><li><strong>NEW</strong> → Created</li><li><strong>RUNNABLE</strong> → Ready</li><li><strong>RUNNING</strong> → Executing</li><li><strong>WAITING</strong> → Waiting</li><li><strong>BLOCKED</strong> → Waiting for lock</li><li><strong>TERMINATED</strong> → Finished</li></ul><h3>start() vs run()</h3><h3>start()</h3><p>✅ Creates a <strong>new thread</strong>.</p><h3>run()</h3><p>❌ Normal method call.</p><p>No new thread.</p><h3>run() Directly?</h3><pre>t.run();</pre><pre>Runs inside Main Thread.</pre><p>No multithreading.</p><h3>join()</h3><p>One thread waits until another thread finishes.</p><h3>sleep()</h3><p>Thread sleeps for a fixed time.</p><h3>yield()</h3><p>Thread gives another thread a chance to use the CPU.</p><h3>interrupt()</h3><p>Interrupts a sleeping or waiting thread.</p><h3>isAlive()</h3><p>Checks whether a thread is still running.</p><p>Returns</p><pre>true</pre><pre>or</pre><pre>false</pre><h3>sleep() vs join() vs yield()</h3><p>sleep()join()yield()SleepsWaits for another threadGives CPU chanceTime-basedUntil thread finishesScheduler hint</p><h3>Restart Dead Thread?</h3><p>❌ No.</p><p>A thread can be started <strong>only once</strong>.</p><h3>PART 3 — Thread Priority &amp; Naming</h3><h3>Thread Priority</h3><p>Range</p><pre>1 → 10</pre><p>Default</p><pre>5</pre><p>Constants</p><pre>MIN_PRIORITY = 1<br>NORM_PRIORITY = 5<br>MAX_PRIORITY = 10</pre><p>Higher priority = Higher <strong>chance</strong>, <strong>not guarantee</strong>.</p><h3>Thread Name</h3><p>Default</p><pre>Thread-0<br>Thread-1</pre><pre>Methods</pre><pre>setName()<br>getName()</pre><h3>Same Priority?</h3><p>Scheduler decides.</p><h3>Can Change Later?</h3><p>✅ Yes.</p><p>Name and priority can be changed after start.</p><h3>currentThread() vs this</h3><p><strong>currentThread()</strong> → Current executing thread</p><p><strong>this</strong> → Current object</p><h3>Can start() be called twice?</h3><p>❌ No.</p><p>Throws <strong>IllegalThreadStateException</strong>.</p><h3>PART 4 — Performing Multiple Tasks</h3><h3>Multiple Threads</h3><pre>Thread 1 → Download<br>Thread 2 → Music<br>Thread 3 → Print</pre><p>Runs concurrently.</p><h3>Single Thread</h3><pre>Download<br>↓<br>Music<br>↓<br>Print</pre><p>Runs one by one.</p><h3>Multiple run() Methods?</h3><p>❌ No.</p><p>One thread has <strong>one </strong><strong>run()</strong> method.</p><p>Inside it, you can call many methods.</p><pre>run()</pre><pre>↓</pre><pre>download()</pre><pre>↓</pre><pre>save()</pre><pre>↓</pre><pre>print()</pre><h3>Single-threaded vs Multi-threaded</h3><h3>Single Thread</h3><pre>Task 1<br>↓<br>Task 2<br>↓<br>Task 3</pre><h3>Multi Thread</h3><pre>Task 1</pre><pre>Task 2</pre><pre>Task 3</pre><h3>Lambda Expression</h3><pre>new Thread(() -&gt; {<br>    System.out.println(&quot;Task&quot;);<br>}).start();</pre><h3>🧠 Jarvis Memory Map</h3><pre>Multitasking<br>      ↓<br>Process vs Thread<br>      ↓<br>Thread<br>      ↓<br>Multithreading<br>      ↓<br>Main Thread<br>      ↓<br>Thread Creation<br>      ↓<br>Thread Life Cycle<br>      ↓<br>start() vs run()<br>      ↓<br>sleep() • join() • yield() • interrupt()<br>      ↓<br>Priority &amp; Naming<br>      ↓<br>Multiple Tasks<br>      ↓<br>Anonymous Class &amp; Lambda</pre><p><strong>🎯 Interview Formula</strong></p><blockquote><strong><em>Process → Thread → Multithreading → Main Thread → Thread Creation → Life Cycle → start/run → sleep/join/yield → Priority → Multiple Tasks.</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a1d8979ca1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Collection-rev]]></title>
            <link>https://amn24.medium.com/collection-rev-09b65c32e440?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/09b65c32e440</guid>
            <category><![CDATA[doubly-linked-list]]></category>
            <category><![CDATA[linked-lists]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 05:05:57 GMT</pubDate>
            <atom:updated>2026-06-23T05:05:57.616Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*fp11m9klDr1pC8-lsNxtHA.png" /></figure><p>Linked_listA A</p><ul><li>linked list is a type of data structure implemented as a doubly linked list in which each element is stored inside a node object.</li><li>Each node consists of three parts:</li><li>previous node addr → data → next node addr</li></ul><p>*Advantages</p><ul><li>fast insertion -&gt;no sifting the lement ike arraylist</li><li>fast deletion -&gt;</li><li>no fixed capacity /dynamic size<br> *dis</li><li>Slow searching, unlike an ArrayList, in which traversing is by index</li><li>Random access is slow</li><li>Take extra memory while in a node object, it consists of previous us addr →data →next node addr</li></ul><h3>Give a real-life example of using a linked list</h3><ul><li>Browsing history like next page ←&gt; previous page</li><li>music playlist</li><li>undo redo feature</li></ul><p>/Synchronization is a mechanism used to ensure only one thread can access the shared resource or object at a time,<br> making a program ahead-of-time safe and preventing inconsistency</p><p>//Non-synchronization is used to ensure that multiple threads can access the same resources simultaneously<br> It is a faster, more performance-efficient</p><h3>How to make a linked list as asynchronous</h3><p>List list =Collection.syncronizedList(new LinkedList&lt;&gt;());</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*anqt9i0NiCXc_RpkurBCCQ.png" /></figure><h3>Vector — — — — — — — — — — — <em>Vectoror is a legacy class that implements the List interface</em></h3><p>It stores the element in a dynamic array</p><ul><li>maintain insertion order, allows duplicate and null values, and synchronized + thread safe</li><li>Java internally uses a dynamic array means in the array becomes full, if u add more element no need to again intialzation; it will automatically increase the size of the array to double and then store the element into a new array</li><li>Java is synchronized in nature and thread-safe</li><li>initial and default capacity of vector is 10, if we increase the size, the value becomes double</li><li>Yes, we can store the null &amp; duplicate values in a vector</li></ul><h3>Constructors in a vector class :</h3><ol><li>default constructor -creates the empty vector with an initial capacity of 10 — Vector list =new Vector&lt;&gt;();</li><li>initial capacity constructor -create a vector with capacity -Vector list =new Vector&lt;&gt;(20</li><li>initial capacity + increment constructor -same as before, but addition of increment by the value -Vector list =new Vector&lt;&gt;(20,5); // 5 is increment</li><li>Collection constructor — Creates a Vector containing all elements from another collection -Vector vector = new Vector&lt;&gt;(list);</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09b65c32e440" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chapter-Spring Framework]]></title>
            <link>https://amn24.medium.com/chapter-spring-framework-ea74b9f3b1d5?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea74b9f3b1d5</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[systems-thinking]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 19:48:27 GMT</pubDate>
            <atom:updated>2026-06-22T19:48:27.733Z</atom:updated>
            <content:encoded><![CDATA[<p>Spring Core Concepts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*NMXCNDQ1kzcWmFLK.jpg" /></figure><h3>Module 1: Introduction to Spring Framework</h3><ol><li>What is Spring Framework?</li><li>History of Spring</li><li>Why Spring?</li><li>Advantages of Spring Framework</li><li>Features of Spring</li><li>Spring Framework Architecture</li><li>Spring Modules</li><li>Spring Core vs Spring Boot</li><li>POJO (Plain Old Java Object)</li><li>Enterprise Application</li></ol><h3>Module 2: Spring Core Fundamentals</h3><ol><li>What is Spring Core?</li><li>What is IoC (Inversion of Control)?</li><li>What is Dependency Injection (DI)?</li><li>Types of Dependency Injection</li></ol><ul><li>Constructor Injection</li><li>Setter Injection</li></ul><ol><li>IoC Container</li><li>Bean Factory</li><li>ApplicationContext</li><li>Difference between BeanFactory and ApplicationContext</li></ol><p>Difference between BeanFactory and ApplicationContext</p><h3>Module 3: Spring Beans</h3><ol><li>What is a Bean?</li><li>Bean Lifecycle</li><li>Bean Scope</li></ol><ul><li>Singleton</li><li>Prototype</li><li>Request</li><li>Session</li><li>Application</li></ul><ol><li>Bean Configuration</li><li>Bean Naming</li><li>Bean Initialization</li><li>Bean Destruction</li></ol><h3>Module 4: Dependency Injection</h3><ol><li>Constructor Injection</li><li>Setter Injection</li><li>Field Injection</li><li>Which Injection is Best?</li><li>Advantages of Dependency Injection</li></ol><h3>Module 5: Spring Configuration</h3><h3>XML Configuration</h3><ol><li>beans.xml</li><li>&lt;bean&gt;</li><li>&lt;property&gt;</li><li>&lt;constructor-arg&gt;</li></ol><h3>Java Configuration</h3><ol><li>@Configuration</li><li>@Bean</li></ol><h3>Annotation Configuration</h3><ol><li>@Component</li><li>@ComponentScan</li><li>@Autowired</li><li>@Qualifier</li><li>@Primary</li><li>@Value</li></ol><h3>Module 6: Autowiring</h3><ol><li>What is Autowiring?</li><li>Types of Autowiring</li></ol><ul><li>byName</li><li>byType</li><li>constructor</li></ul><ol><li>@Autowired</li><li>@Qualifier</li><li>@Primary</li></ol><h3>Module 7: Bean Lifecycle</h3><ol><li>Bean Creation</li><li>Dependency Injection</li><li>Initialization</li><li>Ready to Use</li><li>Destruction</li></ol><p>Annotations:</p><ul><li>@PostConstruct</li><li>@PreDestroy</li></ul><p>Interfaces:</p><ul><li>InitializingBean</li><li>DisposableBean</li></ul><h3>Module 8: Bean Scope</h3><ol><li>Singleton</li><li>Prototype</li><li>Request</li><li>Session</li><li>Application</li><li>WebSocket</li></ol><h3>Module 9: Spring Expression Language (SpEL)</h3><ol><li>What is SpEL?</li><li>@Value</li><li>Expression Examples</li></ol><h3>Module 10: Collections Injection</h3><ol><li>List Injection</li><li>Set Injection</li><li>Map Injection</li><li>Properties Injection</li></ol><h3>Module 11: Standalone Collections</h3><ol><li>Standalone List</li><li>Standalone Map</li><li>Standalone Set</li></ol><h3>Module 12: Annotation-Based Configuration</h3><ol><li>@Component</li><li>@Repository</li><li>@Service</li><li>@Controller</li><li>@Autowired</li><li>@Qualifier</li><li>@Primary</li><li>@Value</li></ol><h3>Module 13: Java-Based Configuration</h3><ol><li>@Configuration</li><li>@Bean</li><li>@ComponentScan</li></ol><h3>Module 14: Spring Stereotype Annotations</h3><ol><li>@Component</li><li>@Service</li><li>@Repository</li><li>@Controller</li><li>@RestController (used mainly with Spring Boot)</li></ol><h3>Module 15: Spring Events (Basic)</h3><ol><li>ApplicationEvent</li><li>EventPublisher</li><li>EventListener</li></ol><h3>Module 16: Spring Profiles</h3><ol><li>@Profile</li><li>Development Profile</li><li>Testing Profile</li><li>Production Profile</li></ol><h3>Module 17: Spring Core Interview Questions</h3><ol><li>What is Spring Framework?</li><li>What is Spring Core?</li><li>What is IoC?</li><li>What is Dependency Injection?</li><li>Difference between IoC and DI.</li><li>What is Bean?</li><li>Bean Lifecycle?</li><li>Bean Scope?</li><li>BeanFactory vs ApplicationContext?</li><li>@Autowired vs @Inject?</li><li>@Qualifier vs @Primary?</li><li>Constructor vs Setter Injection?</li><li>XML Configuration vs Java Configuration vs Annotation Configuration?</li><li>What is @ComponentScan?</li><li>What is Spring Container?</li><li>What are Stereotype Annotations?</li><li>What is SpEL?</li><li>What is @Value?</li><li>What is @PostConstruct?</li><li>What is @PreDestroy?</li></ol><h3>Learning Order (Recommended)</h3><ol><li>Introduction to Spring Framework</li><li>Spring Core</li><li>IoC (Inversion of Control)</li><li>Dependency Injection (DI)</li><li>Spring Container</li><li>BeanFactory</li><li>ApplicationContext</li><li>Spring Beans</li><li>Bean Lifecycle</li><li>Bean Scope</li><li>XML Configuration</li><li>Annotation Configuration</li><li>Java Configuration</li><li>Autowiring</li><li>Stereotype Annotations</li><li>@Value and SpEL</li><li>Collections Injection</li><li>Spring Profiles</li><li>Interview Questions</li><li>Mini Project using Spring Core</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea74b9f3b1d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring_Core]]></title>
            <link>https://amn24.medium.com/spring-core-16f0fa87acd4?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/16f0fa87acd4</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[information-technology]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Thu, 07 May 2026 09:46:10 GMT</pubDate>
            <atom:updated>2026-05-07T09:46:10.600Z</atom:updated>
            <content:encoded><![CDATA[<p>Basic _Concept</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w_xjlDlKlCz1-0cx.png" /></figure><h3>Spring Core</h3><ul><li>Spring Core is the base module of the Spring Framework.</li><li>If used alone, we can build simple standalone applications.</li><li>If used with other Spring modules, we can build:</li><li>Web applications</li><li>Enterprise applications</li><li>Large systems</li></ul><h3>Spring Containers</h3><p>Spring Core provides two IoC containers:</p><ol><li><strong>BeanFactory</strong></li></ol><ul><li>Basic IoC container</li></ul><ol><li><strong>ApplicationContext</strong></li></ol><ul><li>Advanced IoC container</li></ul><h3>Operations Performed by Spring Container</h3><h3>1) Spring Bean Life Cycle Management</h3><ul><li>Manages the complete life cycle of a Spring Bean:</li><li>Object creation</li><li>Initialization</li><li>Usage</li><li>Destruction</li></ul><h3>2) Dependency Management</h3><ul><li>Arranging/assigning one class object to another class object.</li><li>Helps classes communicate with each other.</li></ul><h3>Spring Bean</h3><p>A Java class whose object is created and managed by the IoC container is called a <strong>Spring Bean</strong>.</p><h3>IoC Container Responsibilities</h3><ul><li>Loads the Java class</li><li>Creates the object</li><li>Manages the object</li><li>Calls life cycle methods</li><li>Destroys the object if needed</li></ul><h3>Bean Configuration</h3><p>To make the IoC container recognize a class as a Spring Bean, we must provide configuration.</p><p>Spring will not automatically identify every class as a bean.</p><h3>Types of Configuration</h3><h3>1) XML Driven Configuration (Old)</h3><h3>2) Annotation Driven Configuration (Modern)</h3><h3>XML Driven Configuration</h3><p>In XML configuration, IoC container gets instructions from an XML file.</p><p>Recommended XML file name:</p><pre>applicationContext.xml</pre><h3>Bean Configuration Example</h3><pre>&lt;beans&gt;<br>&lt;bean id=&quot;sf&quot;<br>          class=&quot;com.nt.sbeans.SeasonFinder&quot;/&gt;<br>&lt;/beans&gt;</pre><h3>Explanation</h3><ul><li>id → Bean id / object name</li><li>class → Fully qualified class name</li><li>Spring creates object using default constructor</li></ul><h3>Factory Method Bean Instantiation</h3><pre>&lt;bean id=&quot;dt&quot;<br>      class=&quot;java.util.Date&quot;/&gt;<br><br>&lt;bean id=&quot;ldt&quot;<br>      class=&quot;java.time.LocalDate&quot;<br>      factory-method=&quot;now&quot;/&gt;</pre><ul><li>factory-method is used for factory method instantiation.</li></ul><h3>Annotation Driven Configuration</h3><p>To configure user-defined classes as Spring Beans:</p><p>Use:</p><pre>@Component</pre><p>Then enable component scanning:</p><pre>@Configuration<br>@ComponentScan(basePackages = &quot;com.nt.sbeans&quot;)<br>public class AppConfig { }</pre><h3>Example</h3><h3>SeasonFinder.java</h3><pre>package com.nt.sbeans;<br><br>import org.springframework.stereotype.Component;<br>@Component(&quot;sf&quot;)<br>public class SeasonFinder {<br>}</pre><h3>Inversion of Control (IoC)</h3><p>Normally in Java:</p><ul><li>Programmer creates and manages objects manually.</li></ul><p>In Spring:</p><ul><li>Container creates and manages objects.</li></ul><p>That is why it is called:</p><h3>Inversion of Control (IoC)</h3><h3>BeanFactory IoC Container</h3><p>Used to create and manage Spring Beans.</p><p>Mostly used class:</p><pre>XmlBeanFactory</pre><h3>Example</h3><h3>XML File</h3><pre>&lt;beans&gt;<br>&lt;bean id=&quot;car&quot;<br>          class=&quot;Car&quot;/&gt;<br>&lt;/beans&gt;</pre><h3>Load XML File</h3><pre>Resource res =<br>    new FileSystemResource(&quot;applicationContext.xml&quot;);</pre><h3>Create BeanFactory Container</h3><pre>BeanFactory factory =<br>    new XmlBeanFactory(res);</pre><h3>Limitation of BeanFactory</h3><ul><li>Supports only XML driven configuration.</li></ul><h3>ApplicationContext Container</h3><p>ApplicationContext is an advanced version of BeanFactory.</p><h3>Features</h3><ul><li>Supports XML configuration</li><li>Supports annotation configuration</li><li>Mostly used in Spring &amp; Spring Boot</li></ul><h3>Classes Used to Create ApplicationContext</h3><ol><li>FileSystemXmlApplicationContext</li><li>ClassPathXmlApplicationContext</li><li>XmlWebApplicationContext</li></ol><h3>Mostly Used</h3><pre>ClassPathXmlApplicationContext</pre><h3>Dependency Management</h3><p>Dependency management means:</p><ul><li>Arranging one class object into another class object</li><li>So classes can use each other’s services</li></ul><h3>Terminology</h3><h3>Target Class</h3><p>Class which uses another class object.</p><h3>Dependent Class</h3><p>Class which provides services to another class.</p><h3>Ways to Implement Dependency Management</h3><h3>1) Dependency Lookup (DL)</h3><p>Target class searches and gets dependent object manually.</p><h3>Example</h3><ul><li>Calling getBean() on container</li></ul><h3>2) Dependency Injection (DI)</h3><p>Container automatically gives required object to target class.</p><p>Container pushes dependency into target class object.</p><h3>Advantages of DI</h3><ul><li>Less burden on programmer</li><li>Better dependency management</li><li>Loose coupling</li><li>Better maintainability</li></ul><h3>Types of Dependency Injection</h3><h3>Basic DI</h3><ol><li>Setter Injection</li><li>Constructor Injection</li><li>Field Injection</li><li>Arbitrary Injection</li></ol><h3>Advanced DI</h3><ol><li>Lookup Method Injection</li><li>Method Replacement</li></ol><h3>Spring Configuration Approaches</h3><h3>1) XML Driven Configuration</h3><ul><li>All instructions in XML file</li></ul><h3>2) XML + Annotation Configuration</h3><ul><li>Combination approach</li></ul><h3>3) Pure Java / Code Driven Configuration</h3><ul><li>Configuration using Java classes and annotations</li><li>Best modern approach</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16f0fa87acd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This 1-Minute Trick Will Change Your Learning Game]]></title>
            <link>https://amn24.medium.com/this-1-minute-trick-will-change-your-learning-game-b44f6d2578ef?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/b44f6d2578ef</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[psycology]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[approach]]></category>
            <category><![CDATA[quotes]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Fri, 03 Apr 2026 06:11:19 GMT</pubDate>
            <atom:updated>2026-04-03T06:11:19.684Z</atom:updated>
            <content:encoded><![CDATA[<p><em>You don’t need to be a genius.</em><br> <em>You don’t need endless hours of revision.</em></p><p>Just one small habit, one minute at a time — <br> and suddenly… <strong>everything sticks forever.</strong></p><ul><li>habits that have reshaped my life with clarity, positivity, and self-discipline</li><li>Beyond that, I’m consciously choosing simplicity — avoiding unnecessary shopping, embracing a minimalist way of living, respecting elders, and approaching life with a calm, positive mindset.</li><li>how do you define the term exercise ?</li></ul><p>the answer is Exercise is a physical activity that is performed to improve or maintain health and fitness, for me it is an improved mood or mentally fit and gives a power of defense from negativity and it is different from person to person, so here I will discuss about a very basic exercise that you must do daily such as -&gt; Top Exercises That Will Transform Your Body In Just 4 Weeks</p><ul><li>Bonus: Long Distance Walking: Benefits: Improves cardiovascular health and endurance.Aids in weight management and fat loss. It enhances mood and reduces stress. Promotes joint health and flexibility. Low-impact exercise is suitable for people of various fitness levels.</li></ul><p>You’re a great listener — thank you for giving me that space.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b44f6d2578ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring Boot day-2]]></title>
            <link>https://amn24.medium.com/spring-boot-day-2-2225685cbd12?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/2225685cbd12</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 12:23:12 GMT</pubDate>
            <atom:updated>2026-03-18T12:23:12.254Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*UBdjBGMtllXFPXiN.png" /></figure><h3>1. Monolithic Architecture</h3><h3>Idea</h3><p>In <strong>Monolithic Architecture</strong>, the entire application is developed as <strong>one single unit</strong>.<br> All modules/services are packed into <strong>one file</strong>.<br> Examples of packaging:</p><ul><li><strong>JAR file</strong> → Standalone applications</li><li><strong>WAR file</strong> → Web applications / Distributed apps</li></ul><h3>Example in the Image (Bank Project – ICICI Bank)</h3><p>The bank application contains multiple modules:</p><ul><li>Daily Transaction Service</li><li>Loan Service</li><li>Mutual Funds Service</li><li>Locker Service</li><li>Admin Service</li></ul><p>But in <strong>Monolithic Architecture</strong>:<br> All these modules are packed together into <strong>one application file</strong>.<br> Example:<br> BankApp.jar / BankApp.war<br> So the structure becomes:</p><p>Bank Application<br> ├─ Daily Transaction Service<br> ├─ Loan Service<br> ├─ Mutual Fund Service<br> ├─ Locker Service<br> └─ Admin Service</p><p>Everything runs as <strong>one single application</strong>.</p><h3>Problems with Monolithic Architecture</h3><p>The image highlights these problems:</p><h3>1. Hard to reuse modules</h3><p>If another project needs <strong>Loan Service</strong>, it cannot use it separately.<br> Because all services are <strong>packed together in one jar/war file</strong>.</p><h3>2. All modules must be developed in same technology</h3><p>All services must use:</p><ul><li>same language</li><li>same framework</li><li>same deployment</li></ul><p>Example:<br> If the project uses <strong>Spring + Java</strong>, all modules must use it.</p><h3>3. Difficult to maintain large applications</h3><p>If one module changes</p><ul><li>the entire application must be rebuilt</li><li>the entire application must be redeployed</li></ul><h3>2. Microservices Architecture</h3><p>To solve these problems, <strong>Microservices Architecture</strong> is used.</p><h3>Idea</h3><p>Each <strong>service/module becomes an independent project</strong>.<br> Each service has:</p><ul><li>its own code</li><li>its own database</li><li>its own deployment</li></ul><h3>Example in Image</h3><p>The bank system is divided into multiple services:</p><p>Service Project Daily Transaction Service MS1 Mutual Funds Service MS2 Loan Service MS3 Locker Service MS4 Admin Service MS5 Reports Service MS6</p><p>Each service is packaged separately:<br> DailyTxService.war<br> MutualFundsService.war<br> LoanService.war<br> LockerService.war<br> AdminService.war<br> ReportsService.war</p><h3>Important Point in Microservices</h3><p>Each service has <strong>its own database</strong>.<br> Example:</p><p>DailyTx Service → DB<br> Loan Service → DB<br> Mutual Funds Service → DB<br> Reports Service → DB</p><p>This makes services <strong>independent</strong>.</p><h3>3. Communication Between Microservices</h3><p>Since services are separated, they communicate using:</p><ul><li><strong>API Gateway</strong></li><li><strong>Eureka Server (Service Discovery)</strong></li></ul><p>These help services <strong>find and communicate with each other</strong>.</p><h3>4. Common UI</h3><p>The image also shows:</p><p>Common UI for all Microservices</p><p>Users interact with <strong>one UI</strong>, which internally calls different services.</p><p>Example:</p><p>User → UI → API Gateway → Microservices</p><h3>5. Simple Comparison</h3><p>Feature Monolithic Architecture Microservices Architecture Structure Single application Multiple services Deployment One jar/war Multiple jars/wars Database Single DB Multiple DBs Scalability Difficult Easy Maintenance Hard Easier</p><h3>6. Simple Real-Life Analogy</h3><h3>Monolithic</h3><p>One <strong>big restaurant kitchen</strong> doing everything.</p><p>Cooking + Billing + Delivery + Cleaning</p><p>All in one place.</p><h3>Microservices</h3><p>Multiple <strong>specialized kitchens</strong>.<br> Pizza Kitchen<br> Burger Kitchen<br> Drinks Kitchen<br> Dessert Kitchen</p><p>Each works independently but serves the same restaurant.</p><p>✅ <strong>Final Idea</strong></p><p>Monolithic = <strong>One big application</strong><br> Microservices = <strong>Many small independent services</strong></p><p>2nd topic :</p><p>Spring boot =Spring - xml config + Auto config</p><ul><li>Spring boot starter --&gt;Special dependicies (jar files)=prform a autoconfiguration activities</li><li>by spring boot starters nearly 1000+ starters Are available<br> example some staters:<br> web<br> |data-jpa<br> |jdbc<br> |security<br> |test<br> |thymeleaf<br> |actuator</li><li><strong>Maven</strong> is a <strong>build automation tool</strong> that uses <strong>XML configuration</strong>.</li></ul><h3>Main File--&gt;pom.xml</h3><p>What Maven does:</p><ul><li>Downloads required libraries automatically</li><li>Manages project structure</li><li>Builds the project</li><li><strong>Gradle</strong> is a <strong>modern build tool</strong> that uses <strong>Groovy or Kotlin DSL</strong>.<br> Main File--&gt;build.gradle</li></ul><h3>Key Features of Gradle</h3><ul><li>Uses <strong>Groovy / Kotlin (not XML)</strong></li><li>Faster than Maven</li><li>More flexible</li><li>Supports incremental builds</li></ul><p>// JAR-&gt; Java Archive --&gt; package that contained compiled java codes and liberaries ex-</p><ul><li>spring-core.jar</li><li>mysql-connector.jar</li></ul><h3>Simple Flow of JAR files</h3><p>You add → spring-boot-starter-web (Dependent JAR)<br> ↓<br> Maven downloads automatically<br> ↓<br> spring-core, spring-mvc, tomcat… (Relevant JARs)</p><h3>1️⃣ Dependent JAR Files</h3><blockquote><strong><em>Dependent JARs are the libraries that the developer explicitly adds to the project because the application directly needs them.</em></strong></blockquote><p>✔ Added manually in pom.xml (Maven) or build.gradle<br> ✔ Called <strong>Direct Dependencies</strong></p><h3>2️⃣ Relevant JAR Files (Transitive Dependencies)</h3><blockquote><strong><em>Relevant JARs are the libraries that are automatically downloaded by the build tool because they are required by the dependent JARs.</em></strong></blockquote><p>✔ Not added manually<br> ✔ Automatically resolved by Maven/Gradle<br> ✔ Called <strong>Transitive Dependencies</strong></p><h3>🔹 Key Difference</h3><p>Feature Dependent JAR Relevant JAR Definition Added directly by developer Added automatically by build tool Dependency Type Direct dependency Transitive dependency Control Full control by developer Managed by Maven/Gradle Example spring-boot-starter-web spring-core, tomcat Visibility Written in config file Not directly written</p><ul><li>Spring starter gives main jar Files |transitive dependent jar files| relevent jars files</li><li>Relevant JAR files are not called dependent JARs because they are not directly added by the developer; instead, they are indirectly included as dependencies of the main (dependent) JAR file.</li><li>a dataSource object in spring boot is a factory that provides a database connection to ur application</li><li>or u can say DataSource= [connection provider]</li><li>DataSource is an object in Spring Boot that manages and provides database connections efficiently using connection pooling.</li></ul><h3>* JVM languages:</h3><p>Java --&gt;used in Spring boot, Androids ,enterprises apps<br> kotlin --&gt;for android,modern lang<br> Scala --&gt; combine with functional +oop<br> Groovy --&gt;dynamic lang ,used in Gradle build tools</p><p>##STS<strong> stands for ==</strong>Spring Tool Suite**==, an Integrated Development Environment (IDE) specifically designed and tailored for developing applications using the Spring Framework and Spring Boot.</p><p>why do we need a starter in spring boot?</p><h3>✅ Configuration (Auto Configuration)</h3><p>Starter works with Spring Boot to</p><ul><li>Automatically configure components</li><li>No XML required</li><li>Minimal setup</li></ul><p>👉 Just add starter + properties → done</p><h3>✅ Dependent JAR (Only One)</h3><p>You add <strong>only one dependency</strong>:<br> spring-boot-starter-web<br> 👉 This becomes your <strong>only direct (dependent) JAR</strong></p><h3>✅ Relevant JARs (Handled Automatically)</h3><p>Spring Boot automatically downloads:</p><ul><li>spring-core</li><li>spring-web</li><li>spring-mvc</li><li>jackson</li><li>embedded tomcat</li></ul><p>👉 These are <strong>relevant (transitive) JARs</strong></p><p>1️⃣ Spring Boot Starters<br> 2️⃣ Auto Configuration<br> 3️⃣ Spring Boot CLI<br> 4️⃣ Actuator</p><h3>1️⃣ Spring Boot Starters</h3><h3>What it is:</h3><blockquote><em>Predefined dependency packages for specific features.</em></blockquote><h3>Purpose:</h3><ul><li>Reduce manual dependency setup</li><li>Provide ready-to-use libraries</li></ul><h3>Example:</h3><ul><li>spring-boot-starter-web</li><li>spring-boot-starter-data-jpa</li></ul><p>👉 You add <strong>one starter → many JARs are added automatically</strong></p><h3>2️⃣ Auto Configuration</h3><h3>What it is:</h3><blockquote><em>Automatically configures your application based on dependencies.</em></blockquote><h3>Purpose:</h3><ul><li>Removes manual configuration</li><li>No need for XML setup</li></ul><h3>Example:</h3><p>If you add:<br> spring-boot-starter-we<br> Spring Boot automatically configures:</p><ul><li>DispatcherServlet</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2225685cbd12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring Boot day-1]]></title>
            <link>https://amn24.medium.com/spring-boot-day-1-b7836088ea50?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7836088ea50</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[spring-framework]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 12:16:33 GMT</pubDate>
            <atom:updated>2026-03-18T12:16:33.902Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*yhlW4dR3pTbZTJZz.png" /></figure><ul><li>Spring Boot = Spring Framework + Auto-configuration</li><li>Spring Boot is an extension of Spring Framework → reduces the config and simplifies application development</li><li>problem before spring boot →common logic +application-specefic logic</li><li>To make it free from the common log, Spring Boot comes with which is generated automatically</li><li>2- Spring Framework and Java technologies → [before spring boot]- in Java Technologies manual config and in Spring Framework XML +manual Setup and boilerplate is very high [after spring boot] in Java Technologies Auto config and in Spring Framework Annotation +Auto Setup and boilerplate is very high</li><li>Spring Boot avoids heavy XML configuration files provide a auto Configuration.</li><li>Spring Boot automatically performs many tasks:</li></ul><ol><li>Creates Spring Beans</li><li>Injects dependencies</li><li>Creates in-memory databases</li><li>Establishes database connections</li><li>Provides embedded servers</li><li>Adds required libraries to the classpath</li><li>Performs auto configuration</li></ol><ul><li>Spring IOC container is responsible for creating objects, managing objects, and t, injecting dependencies between objects.</li><li>Java classes whose objects are created and managed by SpringIoCc Container are called Spring Beans.</li></ul><h3>Creates Predefined Classes as Spring Beans</h3><p>Spring Boot automatically creates objects for many classes.<br> Example:</p><ul><li>Controllers</li><li>Services</li><li>Repositories</li><li>Configuration classes</li></ul><p>Example:<br> @Service<br> public class PaymentService {<br> }</p><p>Spring Boot automatically:</p><ul><li>Creates object</li><li>Stores it in a container</li><li>Makes it available to other classes</li><li><strong>Spring automatically connects objects using Dependency injection</strong></li><li><strong>create in-Memory Database [H2 database, Derby]</strong></li><li><strong>Connects with External Databases[Mysql,Postgresql,Sql server]</strong></li><li><strong>Provided Embedded Server</strong></li><li>Spring Framework is like a good worker, and SpringBoott is an intelligent worker</li><li>Projects can build three :<br> 1️⃣ Java Language (Core Java)<br> 2️⃣ Java Technologies (Java EE APIs)<br> 3️⃣ Java Frameworks (Best)</li></ul><p>Types of Applications Using Spring / Spring Boot:<br> 1️⃣ <strong>Standalone Applications</strong><br> runs on <strong>one computer</strong> and is usually used by <strong>one user at a time</strong><br> example:-<br> Java Core programs (main() method)<br> Antivirus software</p><p>2️⃣ <strong>Web Applications</strong><br> works on a <strong>Client–Server architecture</strong>.<br> 1 The user sends a request using a browser<br> 2. Request to go to the web server<br> 3. The server processes the request<br> 4. Response sent back to the browser</p><p>ex-flipkart/amazon/gmail</p><p>3️⃣ <strong>Distributed Applications</strong><br> A <strong>Distributed Application</strong> allows <strong>many client applications</strong> to connect to <strong>one central server</strong> through a network.</p><h3>Clients can be</h3><ul><li>Mobile apps</li><li>Desktop apps</li><li>Web applications</li><li>IoT devices</li><li>Embedded systems</li></ul><p>A <strong>PhonePe server</strong> can be accessed by</p><ul><li>Mobile apps</li><li>Banking systems</li><li>Websites</li><li>IoT devices</li><li>OTT platforms</li></ul><p>4️⃣ <strong>Enterprise Applications</strong><br> An <strong>Enterprise Application</strong> is a <strong>large, complex software system used by organizations (enterprises)</strong> to manage their <strong>business operations</strong>.<br> It usually supports:</p><ul><li>*<em>Many users</em></li><li><strong>Large data</strong></li><li><strong>Multiple systems</strong></li><li><strong>High security and reliability</strong></li></ul><h3>Web Server</h3><p>A <strong>Web Server</strong> runs <strong>web applications</strong> and handles <strong>HTTP requests from browsers</strong>.<br> Example flow:<br> Browser → Web Server → Application → Response<br> Examples:</p><ul><li>Apache Tomcat</li><li>Jetty</li><li>Undertow</li></ul><h3>Application Server</h3><p>An <strong>Application Server</strong> is more powerful.<br> Application Server = <strong>Web Server + Enterprise features</strong><br> Extra features:</p><ul><li>Transaction management</li><li>Security</li><li>Messaging</li><li>Distributed support</li></ul><p>Examples:</p><ul><li>GlassFish</li><li>WebLogic</li><li>WildFly</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7836088ea50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ARRAYS_DAY-5]]></title>
            <link>https://amn24.medium.com/arrays-day-5-2a6b5b02f14a?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a6b5b02f14a</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 11:25:03 GMT</pubDate>
            <atom:updated>2026-03-14T11:25:03.605Z</atom:updated>
            <content:encoded><![CDATA[<p>Maximum Subarray Sum</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*8kbQdufVoi62Zi2p.png" /></figure><h3>Q26) Find the Maximum Subarray Sum (Leetcode 53) [Kadane’s Algorithm]</h3><pre>You are given a integer array nums. Your task is to find a contiguous subarray (containing at least one element) <br>that has the largest sum and return that sum.</pre><pre>Example : -1, 3, 4, -2</pre><pre>Example : -1, 3, 4, -2</pre><h3>Subarray and Sum</h3><pre>Subarray        :   Sum<br>-1              :   -1<br>-1 3            :   2<br>-1 3 4          :   6<br>-1 3 4 -2       :   4<br>3               :   3<br>3 4             :   7<br>3 4 -2          :   5<br>4               :   4<br>4 -2            :   2<br>-2              :   -2</pre><pre>sum = arr[0]<br>maxSum = arr[0]</pre><pre>* We can find out the solution by brute force approach but time complexity is O(n2)</pre><h3>Kadane’s Algorithm</h3><pre>5  6  -3  7  -13  8  -2  5  -6  7  -11  3  10  -10  -6  -10  7  2</pre><h3>Sum of subarray</h3><pre>5                           sum     maxSum<br>5 6                         11      16<br>5 6 -3                      8<br>5 6 -3 7                    15<br>5 6 -3 7 -13                2<br>5 6 -3 7 -13 8              10<br>5 6 -3 7 -13 8 -2           8<br>5 6 -3 7 -13 8 -2 5         13<br>5 6 -3 7 -13 8 -2 5 -6      7<br>5 6 -3 7 -13 8 -2 5 -6 7    14<br>5 6 -3 7 -13 8 -2 5 -6 7 -11    3<br>5 6 -3 7 -13 8 -2 5 -6 7 -11 3  6<br>5 6 -3 7 -13 8 -2 5 -6 7 -11 3 10    16<br>5 6 -3 7 -13 8 -2 5 -6 7 -11 3 10 -10    6<br>5 6 -3 7 -13 8 -2 5 -6 7 -11 3 10 -10 -6     0<br>5 6 -3 7 -13 8 -2 5 -6 7 -11 3 10 -10 -6 -10    -10<br>7                                   7<br>7 2                                 9</pre><h3>Program</h3><pre>package com.ravi.array_primitive;<br><br>public class ArrayDemoEx26<br>{<br>    public static void main(String[] args)<br>    {<br>        //int []arr = {-2,1,-3,4,-1,2,1,-5,4};<br>        int []arr = {-1, 3, 4, -2};<br>        IO.println(maxSubArray(arr));<br>    }<br>    public static int maxSubArray(int []a)<br>    {<br>        int sum = a[0];<br>        int maxSum = a[0];<br>        for(int i=1; i&lt;a.length; i++)<br>        {<br>            if(sum &gt;= 0)<br>            {<br>                sum = sum + a[i];<br>            }<br>            else<br>            {<br>                sum = a[i];<br>            }<br>            if(sum &gt; maxSum)<br>            {<br>                maxSum = sum;<br>            }<br>        }<br>        return maxSum;<br>    }<br>}</pre><h3>What is 2a D (Two-Dimensional Array)?</h3><p>A two-dimensional array is an array of arrays.</p><p>It stores data in rows and columns (like a table or matrix).</p><p>Example : 3 rows &amp; 3 columns</p><pre>1 2 3<br>4 5 6<br>7 8 9</pre><h3>Diagram</h3><pre>0   1   2<br>0   [01  02  03]<br>1   [10  11  12]<br>2   [20  21  22]</pre><h3>Program</h3><pre>package com.ravi.array_primitive;<br><br>import java.util.Arrays;<br>import java.util.Scanner;<br>public class ArrayDemoEx27<br>{<br>    public static void main(String[] args)<br>    {<br>        Scanner sc = new Scanner(System.in);<br>        IO.println(&quot;Enter the number of rows :&quot;);<br>        int rows = Integer.parseInt(sc.nextLine());<br>        IO.println(&quot;Enter the number of columns :&quot;);<br>        int cols = Integer.parseInt(sc.nextLine());<br>        int [][]numbers = new int[rows][cols];<br>        IO.println(&quot;Initializing the 2D array :&quot;);<br>        for(int i=0; i&lt;rows; i++)<br>        {<br>            for(int j=0; j&lt;cols; j++)<br>            {<br>                numbers[i][j] = sc.nextInt();<br>            }<br>        }<br>        IO.println(&quot;1st Approach:&quot;);<br>        for(int i=0; i&lt;rows; i++)<br>        {<br>            for(int j=0; j&lt;cols; j++)<br>            {<br>                IO.print(numbers[i][j]+&quot; &quot;);<br>            }<br>            IO.println();<br>        }<br>        IO.println(&quot;2nd Approach&quot;);<br>        for(int[] num : numbers)<br>        {<br>            for(int element : num)<br>            {<br>                IO.print(element+&quot; &quot;);<br>            }<br>            IO.println(element);<br>        }<br>        IO.println(&quot;3rd Approach&quot;);<br>        IO.println(Arrays.deepToString(numbers));<br>    }<br>}</pre><h3>WAP for a 2D array to print the index position of an element</h3><pre>package com.ravi.array_primitive;<br><br>import java.util.Scanner;<br>public class ArrayExDemo28<br>{<br>    public static void main(String[] args)<br>    {<br>        Scanner sc = new Scanner(System.in);<br>        IO.println(&quot;Enter the number of rows :&quot;);<br>        int rows = Integer.parseInt(sc.nextLine());<br>        IO.println(&quot;Enter the number of columns :&quot;);<br>        int cols = Integer.parseInt(sc.nextLine());<br>        int [][]numbers = new int[rows][cols];<br>        IO.println(&quot;Initializing the 2D array :&quot;);<br>        for(int i=0; i&lt;rows; i++)<br>        {<br>            for(int j=0; j&lt;cols; j++)<br>            {<br>                numbers[i][j] = sc.nextInt();<br>            }<br>        }<br>        int target = Integer.parseInt(IO.readln(&quot;Enter the value to search in the 2D&quot;));<br>        for(int i=0; i&lt;rows; i++)<br>        {<br>            for(int j=0; j&lt;cols; j++)<br>            {<br>                if(numbers[i][j] == target)<br>                {<br>                    IO.println(target+&quot; found at index position &quot;+i+&quot;,&quot;+j);<br>                }<br>            }<br>        }<br>        sc.close();<br>    }<br>}</pre><h3>Matrix Addition</h3><pre>package com.ravi.array_primitive;<br>public class ArrayDemoEx29<br>{<br>    public static void main(String[] args)<br>    {<br>        int a[][]={{1,3,5},{2,4,6}}; //2 rows and 3 columns<br>        int b[][]={{5,7,9},{1,1,1}}; //2 rows and 3 columns<br>        //Matrix to perform addition<br>        int sum[][] = new int[2][3];<br>        //adding and printing addition of 2 matrices<br>        for(int i=0;i&lt;2;i++)<br>        {<br>            for(int j=0;j&lt;3;j++)<br>            {<br>                sum[i][j] = a[i][j] + b[i][j];<br>                System.out.print(sum[i][j]+&quot; &quot;);<br>            }<br>            System.out.println();<br>        }<br>    }<br>}</pre><p>Output</p><pre>6 10 14<br>3 5 7</pre><h3>Jagged Array (Each row can have a different number of columns)</h3><p>A Jagged array is a 2D array where each row can have a different number of columns.</p><h3>Diagram</h3><pre>COLUMN 0   COLUMN 1   COLUMN 2<br><br>ROW0    19    29    84<br>ROW1     2   101     9    68    43<br>ROW2    99</pre><h3>Program</h3><pre>package com.ravi.array_primitive;<br><br>public class ArrayDemoEx30<br>{<br>    public static void main(String[] args)<br>    {<br>        int[][] arr = new int[3][];<br>        arr[0] = new int[2];<br>        arr[1] = new int[4];<br>        arr[2] = new int[3];<br>        // Assigning values<br>        arr[0][0] = 10;<br>        arr[0][1] = 20;<br>        arr[1][0] = 30;<br>        arr[1][1] = 40;<br>        arr[1][2] = 50;<br>        arr[1][3] = 60;<br>        arr[2][0] = 70;<br>        arr[2][1] = 80;<br>        arr[2][2] = 90;<br>        // Printing Jagged array<br>        for(int i=0; i&lt;arr.length; i++)<br>        {<br>            for(int j=0; j&lt;arr[i].length; j++)<br>            {<br>                IO.print(arr[i][j]+&quot; &quot;);<br>            }<br>            IO.println();<br>        }<br>    }<br>}</pre><h3>Program on Instance Method Reference</h3><pre>package com.ravi.method_ref;<br><br>@FunctionalInterface<br>interface Worker<br>{<br>    void work();<br>}<br>public class MethodRefDemo<br>{<br>    public static void main(String[] args)<br>    {<br>        Worker w = new Employee()::work;<br>        w.work();<br>    }<br>}<br>class Employee<br>{<br>    public void work()<br>    {<br>        IO.println(&quot;Employee is working&quot;);<br><br>}<br>}</pre><h3>Program on Static Method Reference</h3><pre>package com.ravi.method_ref;<br><br>@FunctionalInterface<br>interface Worker<br>{<br>    void work();<br>}<br>public class MethodRefDemo<br>{<br>    public static void main(String[] args)<br>    {<br>        Worker w = Employee::work;<br>        w.work();<br>    }<br>}<br>class Employee<br>{<br>    public static void work()<br>    {<br>        IO.println(&quot;Employee is working&quot;);<br>    }<br>}</pre><h3>Constructor Reference (ClassName::new)</h3><pre>package com.ravi.method_ref;<br><br>import java.util.function.Function;<br>import java.util.function.Supplier;<br>class Student<br>{<br>    public Student()<br>    {<br>        IO.println(&quot;No argument constructor of Student class&quot;);<br>    }<br>    public Student(String name)<br>    {<br>        IO.println(&quot;Student Name is :&quot;+name);<br>    }<br>    public void m1()<br>    {<br>        IO.println(&quot;m1 non static method&quot;);<br>    }<br>}</pre><pre>public class ConstructorReference<br>{<br>    public static void main(String[] args)<br>    {<br>        Supplier&lt;Student&gt; s1 = Student::new;<br>        Student st = s1.get();<br>        st.m1();<br><br>Function&lt;String,Student&gt; s2 = Student::new;<br>        Student apply = s2.apply(&quot;raj&quot;);<br>        apply.m1();<br>    }<br>}</pre><h3>Arbitrary Method Reference</h3><pre>Calling the non static method directly with the class name.<br><br>str -&gt; str.length()              String::length<br>s -&gt; s.toLowerCase()             String::toLowerCase<br>(i1,i2) -&gt; i1.compareTo(i2)      Integer::compareTo</pre><h3>Program</h3><pre>package com.ravi.method_ref;<br><br>import java.util.Arrays;<br>public class Arbitrary<br>{<br>    public static void main(String[] args)<br>    {<br>        Integer []arr = {50,40,80,20,10};<br>        Arrays.sort(arr, Integer::compareTo);<br>        IO.println(Arrays.toString(arr));<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a6b5b02f14a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ARRAYS_DAY-4]]></title>
            <link>https://amn24.medium.com/arrays-day-4-5292ae3451c7?source=rss-3f5e238209ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/5292ae3451c7</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[maximum-subarray]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aman Verma]]></dc:creator>
            <pubDate>Thu, 12 Mar 2026 06:33:14 GMT</pubDate>
            <atom:updated>2026-03-12T06:33:14.100Z</atom:updated>
            <content:encoded><![CDATA[<p>2D Arrays and Sub-Array</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*8kbQdufVoi62Zi2p.png" /></figure><h3>Q24) Given a non-empty array of integers arr, every element appears twice except for one. Find that single one.</h3><pre>int []arr = {5,1,2,4,3,1,2,4,3};<br>Every Element is appearing twice except 5 so the answer should be 5.</pre><pre>package com.ravi.array_primitive;<br><br>import java.util.HashMap;<br>public class ArrayExDemo23 {<br>    public static void main(String[] args)<br>    {<br>        int []arr = {5,1,2,4,3,1,2,4,3};<br>        HashMap&lt;Integer, Integer&gt; map = new HashMap&lt;&gt;(); //5 1 2 4 3 1<br>        for(int element : arr)<br>        {<br>            map.put(element, map.getOrDefault(element,0) + 1);<br>        }<br>        for(int key : map.keySet()) //5 1 2 4 3<br>        {<br>            if(map.get(key) == 1)<br>            {<br>                IO.println(key);<br>            }<br>        }<br>    }<br>}</pre><pre>package com.ravi.array_primitive;<br><br>import java.util.HashMap;<br>public class ArrayDemoEx24 {<br>    public static void main(String[] args)<br>    {<br>        HashMap&lt;String,Integer&gt; map = new HashMap&lt;&gt;();<br>        String str = &quot;Java is a fun language, Java is awesome, Java is<br> beautiful&quot;;<br>        String[] words = str.split(&quot; &quot;);<br>        for(String word : words)<br>        {<br>            map.put(word, map.getOrDefault(word,0)+1);<br>        }<br>        IO.println(&quot;Frequency is :&quot;+map);<br>    }<br>}</pre><h3>What is a subarray in an original array</h3><p>• A susubarrays theart of the original array.<br> • It represents a continuous (adjacent) element in the existing array.</p><pre>int []arr = {1,2,3,4,5};</pre><p>Range of Index → Sub array of Original Array</p><pre>0 - 0      1<br>0 - 1      1 2<br>0 - 2      1 2 3<br>0 - 3      1 2 3 4<br>0 - 4      1 2 3 4 5<br><br>1 - 1      2<br>1 - 2      2 3<br>1 - 3      2 3 4<br>1 - 4      2 3 4 5<br><br>2 - 2      3<br>2 - 3      3 4<br>2 - 4      3 4 5<br><br>3 - 3      4<br>3 - 4      4 5<br><br>4 - 4      5</pre><h3>Logic</h3><pre>for(int i=0; i&lt;arr.length; i++)<br>{<br>    for(int j=i; j&lt;arr.length; j++)<br>    {<br>        for(int k=i; k&lt;=j; k++)   //How to print from i to j<br>        {<br>            IO.println(arr[k]);<br>        }<br>    }<br>}</pre><pre>package com.ravi.array_primitive;<br><br>public class ArrayDemoEx25 {<br>    public static void main(String[] args)<br>    {<br>        int []arr = {1,2,3,4,5};<br>        for(int i=0; i&lt;arr.length; i++)<br>        {<br>            for(int j=i; j&lt;arr.length; j++)<br>            {<br>                for(int k=i; k&lt;=j; k++)<br>                {<br>                    IO.print(arr[k]+&quot; &quot;);<br>                }<br>                IO.println();<br>            }<br>        }<br>    }<br>}</pre><h3>Comparable&lt;T&gt; and Comparator&lt;T&gt; interface</h3><p>• Both are functional interfaces because both contain exactly one abstract method.</p><p>• We can only say two objects are comparable, if the corresponding class implements the Comparable interface.<br> Note String, StringBuffer, StringBuilder a,nd all the Wrapper classes are implementing from Comparable&lt;T&gt;.</p><h3>Comparable&lt;T&gt;</h3><ol><li>Available in jJavalang package</li><li>public int compareTo(T x);</li><li>Due to current class support, we need to modify the BLC class</li><li>Can write only one sorting logic.</li><li>Provides default natural sorting order</li><li>Arrays.sort(T[] obj);<br> OR<br> Collections.sort(List&lt;E&gt; obj)</li></ol><h3>Comparator&lt;T&gt;</h3><ol><li>Available in Java.util package</li><li>public int compare(T x, T y);</li><li>No need to modify the BLC class</li><li>Can write multiple sorting logics</li><li>Provides custom (user-defined) sorting order</li><li>Arrays.sort(T[] obj, Comparator&lt;T&gt; cmp);<br> Collections.sort(List&lt;E&gt; obj, Comparator&lt;T&gt; cmp);<br> list.sort(Comparator&lt;T&gt; cmp)</li></ol><h3>Program on Comparable</h3><pre>package com.ravi.comparable;<br><br>public record Customer(Integer id, String name) implements <br>Comparable&lt;Customer&gt;<br>{<br>    @Override<br>    public int compareTo(Customer c2)<br>    {<br>        return this.name.compareTo(c2.name);<br>    }<br>}</pre><pre>package com.ravi.comparable;<br><br>import java.util.Arrays;<br>public class CustomerComparable {<br>    public static void main(String[] args)<br>    {<br>        int size = Integer.parseInt(IO.readln(&quot;Enter the size :&quot;));<br>        Customer customers[] = new Customer[size];<br>        for(int i=0; i&lt;size; i++)<br>        {<br>            int id = Integer.parseInt(IO.readln(&quot;Enter Customer id :&quot;));<br>            String name = IO.readln(&quot;Enter custom Name :&quot;);<br>            customers[i] = new Customer(id, name);<br>        }<br>        IO.println(&quot;Original Data :&quot;);<br>        for(Customer customer : customers)<br>        {<br>            IO.println(customer);<br>        }<br>        Arrays.sort(customers);<br>        IO.println(&quot;After sorting based on the name :&quot;);<br>        for(Customer customer : customers)<br>        {<br>            IO.println(customer);<br>        }<br>    }<br>}</pre><h3>Limitation of Comparable</h3><p>We have 2 limitations :</p><ol><li>Can write only one sorting logic</li><li>If the BLC class is provided by some 3rd party and we cannot modify the BLC class, then to provide custom sorting, we should usea Comparator.</li></ol><h3>Program on Comparator</h3><pre>package com.ravi.comparator;<br><br>public record Product(Integer id, String name, Double price)<br>{<br>}</pre><pre>package com.ravi.comparator;<br><br>import java.util.Arrays;<br>import java.util.Comparator;<br>public class ProductComparator {<br>    public static void main(String[] args)<br>    {<br>        Product products[] = new Product[3];<br>        products[0] = new Product(222, &quot;Mobile&quot;, 24900);<br>        products[1] = new Product(111, &quot;Laptop&quot;, 29890);<br>        products[2] = new Product(333, &quot;Camera&quot;, 21900);<br>        IO.println(&quot;Original Data :&quot;);<br>        for(Product product : products)<br>        {<br>            IO.println(product);<br>        }<br>        IO.println(&quot;Sorting based on the Product Id :&quot;);<br>        Comparator&lt;Product&gt; cmpId = new Comparator&lt;Product&gt;()<br>        {<br>            @Override<br>            public int compare(Product p1, Product p2)<br>            {<br>                return Integer.compare(p1.id(), p2.id());<br>            }<br>        };<br>        Arrays.sort(products, cmpId);<br>        for(Product product : products)<br>        {<br>            IO.println(product);<br>        }<br>        IO.println(&quot;Sorting based on the Product Name :&quot;);<br>        Comparator&lt;Product&gt; cmpName = (p1,p2) -&gt; p1.name().compareTo(p2.name());<br>        Arrays.sort(products, cmpName);<br>        for(Product product : products)<br>        {<br>            IO.println(product);<br>        }<br>        IO.println(&quot;Sorting based on the Product price :&quot;);<br>        Arrays.sort(products, (p1,p2) -&gt; Double.compare(p1.price(), p2.price()));<br>        for(Product product : products)<br>        {<br>            IO.println(product);<br>        }<br>    }<br>}</pre><pre>Explanation from diagram:</pre><p>• HashMap has <strong>16 buckets,</strong> and the entire HashMap gets locked, so only one thread can access it at a time.</p><p>• ConcurrentHashMap uses <strong>Bucket Level Locking</strong>.</p><p>• For 16 buckets, <strong>16 locks are available</strong>, so multiple threads can access different buckets simultaneously.</p><p>• Developers can set the number of locks using the <strong>concurrency level constructor</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5292ae3451c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>