<?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 Jahnavi Vetukuri on Medium]]></title>
        <description><![CDATA[Stories by Jahnavi Vetukuri on Medium]]></description>
        <link>https://medium.com/@jahnavivetukuri?source=rss-c52eea1b11bc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*W3NNkFWOIyZIAZftYk-iCg.png</url>
            <title>Stories by Jahnavi Vetukuri on Medium</title>
            <link>https://medium.com/@jahnavivetukuri?source=rss-c52eea1b11bc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:00:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jahnavivetukuri/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[Getting Started with Angular Front-End Development: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@jahnavivetukuri/getting-started-with-angular-front-end-development-a-step-by-step-guide-e61186308ac7?source=rss-c52eea1b11bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/e61186308ac7</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Jahnavi Vetukuri]]></dc:creator>
            <pubDate>Tue, 17 Oct 2023 10:35:42 GMT</pubDate>
            <atom:updated>2023-11-11T12:59:51.335Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHFbpOCGT-RCp-MAP7TCCA.png" /></figure><h3>Introduction to Angular</h3><p>Angular is a popular and powerful front-end framework for web application development. Developed and maintained by Google, Angular simplifies the process of creating dynamic, interactive, and feature-rich web applications.</p><p>It is written in TypeScript, a superset of JavaScript, and offers a component-based architecture that promotes modularity, reusability, and maintainability.</p><p>Whether you are a seasoned developer or a newcomer to web development, this guide will help you get started with Angular, from installation to your first project.</p><h4>Step 1: Prerequisites</h4><p>Before you dive into Angular development, ensure you have the following prerequisites in place:</p><ol><li><strong>Node.js</strong>: Angular requires Node.js, a JavaScript runtime, and npm (Node Package Manager). Download and install Node.js from <a href="https://nodejs.org/">nodejs.org</a>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Wt96QGPdxI-V1BzZE14qg.png" /></figure><p>2.<strong> IDE (Integrated Development Environment):</strong> You can use any code editor or IDE of your choice, such as Visual Studio Code, WebStorm, or Sublime Text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FS-BP9vPU50CX6tRRZKwFw.png" /></figure><h4>Step 2: Installing Angular CLI</h4><p>Angular CLI (Command Line Interface) is a powerful tool that simplifies creating, building, and deploying Angular applications. To install it, open your terminal and run the following command:</p><pre>npm install -g @angular/cli</pre><p>The -g flag ensures that Angular CLI is installed globally on your system.</p><h4>Step 3: Creating Your First Angular Project</h4><p>Now that Angular CLI is installed, you can create a new Angular project. Navigate to the directory where you want to create your project and run the following command:</p><pre>ng new my-first-angular-app</pre><p>Angular CLI will prompt you to answer a few questions about project configuration, including whether to include Angular routing(<em>give ‘n’ if you are a beginner</em>) and which stylesheets to use (CSS, SCSS, etc.)(<em>just click ‘Enter’ to select CSS</em>). Once you’ve answered these questions, Angular CLI will generate the project structure for you.</p><h4>Step 4: Exploring Your Project Structure</h4><p>Angular CLI will create a directory called my-first-angular-app (or your chosen project name). Inside this directory, you will find various files and folders that make up your Angular project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4cPxp-j3lTzpCfc2ZmhrVw.png" /></figure><p>Here are some of the essential files and directories:</p><ul><li><strong>src</strong>: This directory contains the source code of your Angular application, including components, services, and HTML templates.</li><li><strong>app</strong>: Inside the src directory, you&#39;ll find the app directory, which holds your application&#39;s components.</li><li><strong>index.html</strong>: The main HTML file that serves as the entry point for your application.</li><li><strong>main.ts</strong>: The main TypeScript file where the application is bootstrapped.</li><li><strong>angular.json</strong>: Configuration file for your Angular project.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPpkptK4eJKXYO4KInmrlQ.png" /></figure><h4>Step 5: Running Your Angular Application</h4><p>To see your Angular application in action, navigate to your project directory using the terminal and run the following command:</p><pre>ng serve</pre><p>This command compiles your code and starts a development server. By default, your application will be accessible at http://localhost:4200/. Open a web browser and go to this URL to see your Angular app live.</p><p>By default, the following page is shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*REzWwJWRspCeUIr6E1_5JQ.png" /></figure><h4>Step 6: Making Your First Change</h4><p>Now that your application is up and running, let’s make a simple change to understand how Angular works. Open the src/app/app.component.html file and replace the contents with something like:</p><pre>&lt;h1&gt;Welcome to My Angular App!&lt;/h1&gt;</pre><p>Save the file, and you’ll see the changes reflected immediately in your browser, thanks to Angular’s automatic reloading during development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VetOy7lkT6mBb9yuMEJ9AQ.png" /></figure><p>Congratulations! You’ve successfully set up an Angular development environment, created your first project, and made a simple change. You’re now ready to explore Angular’s powerful features and create dynamic web applications.</p><blockquote>In upcoming articles, we will delve deeper into Angular concepts, including components, modules, and services. Stay tuned for more insights into Angular front-end development!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e61186308ac7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Priority Queues in Healthcare: Optimizing Patient Care]]></title>
            <link>https://medium.com/@jahnavivetukuri/priority-queues-in-healthcare-optimizing-patient-care-9c827b9f7b44?source=rss-c52eea1b11bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c827b9f7b44</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Jahnavi Vetukuri]]></dc:creator>
            <pubDate>Fri, 01 Sep 2023 14:47:48 GMT</pubDate>
            <atom:updated>2023-09-01T14:47:48.880Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Imagine you’re responsible for managing a busy hospital. The hospital deals with a constant influx of patients with varying degrees of medical urgency. You need an efficient system to prioritize and manage patient care to ensure that critical cases receive immediate attention. Read on to find out how we can solve this.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6NSQl_cmPNszE5BBJW0Ckw.gif" /></figure><blockquote>If you are new to my blog series, check out other wonderful blogs I have written. You may check it out <a href="https://medium.com/@jahnavivetukuri">here</a>.</blockquote><p>In the fast-paced world of healthcare, every minute counts. Timely and efficient patient care is not just a goal; it’s a necessity. Hospitals and medical facilities must constantly find ways to optimize their processes to ensure that patients receive the care they need when they need it. One powerful tool in achieving this goal is the use of priority queues.</p><h3>Understanding Priority Queues</h3><p>Before we dive into the ways priority queues are transforming healthcare, let’s clarify what a priority queue is. At its core, a priority queue is a data structure that manages a collection of elements, each of which has an associated priority. The key characteristic of a priority queue is that it always dequeues the element with the highest priority.</p><p>In the context of healthcare, elements in the priority queue represent tasks or patients, and their priority is determined by the urgency of their medical condition or the importance of the task. This ensures that critical cases are handled promptly, aligning perfectly with the principle of patient-centered care.</p><h3>Triage and Patient Prioritization</h3><p>Priority queues help healthcare professionals prioritize patients based on the severity of their condition. Critical cases, such as those involving cardiac arrest or trauma, are given the highest priority, ensuring that life-saving interventions happen without delay.</p><h3>Code Implementation</h3><p>Let us quickly jump into how we can implement this in Java.</p><p>Firstly, let us create a class Patient</p><p><strong><em>Patient Class:</em></strong> This class represents a patient and includes their name and priority level. Priority is typically assigned as 1 for critical cases, 2 for high-priority cases, 3 for medium-priority cases, and 4 for low-priority cases.</p><pre>// Class to represent a patient<br>class Patient {<br>    private String name;<br>    private int priority; // 1 for critical, 2 for high, 3 for medium, 4 for low<br><br>    public Patient(String name, int priority) {<br>        this.name = name;<br>        this.priority = priority;<br>    }<br><br>    public int getPriority() {<br>        return priority;<br>    }</pre><p><strong><em>Task Class:</em></strong> The Task class represents tasks associated with patients. Each task has a description and is associated with a patient. It also implements the Comparable interface to enable tasks to be compared based on patient priority.</p><pre>// Class to represent a task<br>class Task implements Comparable&lt;Task&gt; {<br>    private String description;<br>    private Patient patient;<br><br>    public Task(String description, Patient patient) {<br>        this.description = description;<br>        this.patient = patient;<br>    }<br><br>    public Patient getPatient() {<br>        return patient;<br>    }<br><br>    @Override<br>    public int compareTo(Task otherTask) {<br>        // Tasks are compared based on patient priority<br>        return Integer.compare(this.patient.getPriority(), otherTask.getPatient().getPriority());<br>    }<br><br>    @Override<br>    public String toString() {<br>        return &quot;Task: &quot; + description + &quot; for &quot; + patient;<br>    }<br>}</pre><p><strong><em>HospitalTaskScheduling Class: </em></strong>This class contains the main method and serves as the entry point of the program. Inside the main method:</p><ul><li>A PriorityQueue named taskQueue is created to manage tasks. The priority queue is designed to prioritize tasks based on their associated patients&#39; priority levels.</li><li>Several patients with different priority levels (critical, high, and medium) are created, and corresponding tasks are added to the taskQueue.</li><li>The program then processes the tasks in priority order using a while loop, ensuring that tasks associated with patients with higher priority levels are processed first.</li></ul><pre>public class HospitalTaskScheduling {<br>    public static void main(String[] args) {<br>        PriorityQueue&lt;Task&gt; taskQueue = new PriorityQueue&lt;&gt;();<br><br>        // Simulate patient arrivals and task scheduling<br>        Patient patient1 = new Patient(&quot;John&quot;, 1); // Critical<br>        Patient patient2 = new Patient(&quot;Sarah&quot;, 2); // High<br>        Patient patient3 = new Patient(&quot;Mike&quot;, 3);  // Medium<br><br>        taskQueue.add(new Task(&quot;Emergency surgery&quot;, patient1));<br>        taskQueue.add(new Task(&quot;X-ray and examination&quot;, patient2));<br>        taskQueue.add(new Task(&quot;Blood test&quot;, patient3));<br><br>        // Process tasks in priority order<br>        while (!taskQueue.isEmpty()) {<br>            Task task = taskQueue.poll();<br>            System.out.println(&quot;Processing: &quot; + task);<br>        }<br>    }<br>}</pre><p>taskQueue.poll(): This method is part of the PriorityQueue class in Java. It retrieves and removes the element with the highest priority (i.e., the smallest value based on the natural order or the custom order provided) from the priority queue. In the context of the hospital task scheduling, it gets the task with the highest-priority patient.</p><p><strong>Alternatives:</strong></p><p>While taskQueue.poll() is the most common and straightforward way to retrieve the highest-priority element from a PriorityQueue, there are alternatives:</p><ul><li>taskQueue.peek(): This method retrieves the highest-priority element without removing it from the queue. It&#39;s useful when you need to check the next task to be processed without actually processing it.</li><li>Custom Sorting: If you want more control over the order in which tasks are processed, you can use a Comparator to define a custom ordering for tasks. Then, you can use taskQueue.remove() to remove a specific task based on your custom criteria.</li></ul><h4>Conclusion: The Universal Utility of Priority Queues</h4><p>In the world of computing and beyond, priority queues prove their worth by efficiently managing and processing tasks, events, or data based on predefined priorities. These dynamic data structures find application in diverse domains:</p><ul><li><strong><em>Computer Science and Algorithms:</em></strong> Fueling crucial algorithms for routing, shortest paths, and more.</li><li><strong><em>Networking:</em></strong> Prioritizing data packets for efficient transmission.</li><li><strong><em>Emergency Services and Air Traffic Control:</em></strong> Ensuring swift responses and safe operations.</li><li><strong><em>Finance, Call Centers, and Real-Time Systems:</em></strong> Streamlining operations and enhancing user experiences.</li><li><strong><em>Data Compression and Task Scheduling:</em></strong> Optimizing data handling and resource allocation.</li></ul><p>Priority queues are the go-to solution for tasks that require a blend of order, speed, and efficiency. In our fast-paced world, they remain essential tools for achieving excellence in various fields.</p><blockquote>💡Share your insights and experiences in the comments below. Let’s spark a conversation about the future of Java coding!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c827b9f7b44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Auto-complete with Binary Search Tree]]></title>
            <link>https://medium.com/@jahnavivetukuri/auto-complete-with-binary-search-tree-9e876cdf8141?source=rss-c52eea1b11bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e876cdf8141</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Jahnavi Vetukuri]]></dc:creator>
            <pubDate>Wed, 30 Aug 2023 15:45:55 GMT</pubDate>
            <atom:updated>2023-11-11T12:50:38.187Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In this blog, let us explore how binary search trees transform user interactions. Discover the magic behind auto-complete suggestions and more about real-world applications.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r-o8Hy9z2k3pDUUJ3OucAw.png" /></figure><blockquote>If you are new to my blog series, in my previous blog I explained the use case for LinkedLists. You may check it out <a href="https://medium.com/cloudnloud/from-beats-to-nodes-building-dynamic-playlists-with-linked-lists-6d4a0db12a96">here</a>.</blockquote><p><strong>Introduction</strong></p><p>In the world of modern apps and interfaces, user experience takes the top seat. Have you ever wondered how a search bar not only predicts what you’re typing but also does so lightning-fast? This magic is called “<em>auto-complete</em>,” and it’s the reason behind smoother interactions in our digital lives.</p><p>In this blog post, we’ll unravel the secrets of auto-complete suggestions and how they transform the way we search and input data. And the star behind this efficiency? Binary search trees (BSTs) are the unsung heroes that make auto-complete lightning-fast and user-friendly. Let’s explore how this tech duo creates a seamless experience for users.</p><p><strong>Binary Search Trees Demystified</strong></p><p>When it comes to binary search trees (BSTs), the structure is simpler than it sounds. Imagine a family tree, but instead of people, we have numbers. Here’s a breakdown of what makes up a binary search tree:</p><ol><li><strong><em>Nodes and Branches:</em></strong> Just like a family tree has individuals and connections, a BST consists of nodes and branches. Each node holds a number, and the branches connect these nodes in a specific way.</li><li><strong><em>Hierarchy: </em></strong>Similar to generations in a family tree, nodes in a BST have a hierarchy. There’s a “root” node at the top, and the nodes below it are like children and grandchildren, forming levels in the hierarchy.</li><li><strong><em>BSTs have a neat trick:</em></strong> They follow a rule. Every node’s value is bigger than the values in its left “branch” and smaller than those in its right “branch.” This seemingly simple rule has a powerful impact:</li><li><strong><em>Efficient Data Retrieval:</em></strong> This rule creates an organized order. When you’re looking for a number, you can start at the top and follow the branches based on whether the number you’re looking for is smaller or larger. This cuts down search time significantly.</li><li><strong><em>Easy Data Organization:</em></strong> This rule makes sure that when you’re inserting new numbers, they naturally find their correct place in the hierarchy. No need for manual sorting — the tree structure handles it for you.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*JZCaWSfPgVR7w8W1zbx-Ig.jpeg" /><figcaption>Source: Google search</figcaption></figure><p>In a nutshell, binary search trees have a unique structure that optimizes data retrieval and organization by keeping things neatly organized and sorted as you navigate the tree.</p><p>With the unique nature of Binary Search Trees, we can implement auto-complete suggestions easily based on alphabetical comparisons.</p><p>Let us start with the implementation by creating a tree. The code implementation is shown below</p><pre>class TreeNode {<br>    String word;<br>    TreeNode left;<br>    TreeNode right;<br><br>    public TreeNode(String word) {<br>        this.word = word;<br>        this.left = null;<br>        this.right = null;<br>    }<br>}</pre><p>In this implementation, we have a TreeNode class representing the nodes of the binary search tree.</p><p>Now to add the elements in such a way that it behaves as a BST, the implementation is shown below</p><p>The BinarySearchTree class manages the tree structure, allowing the insertion of words and generating auto-complete suggestions.</p><p>The insert method inserts words into the binary search tree, maintaining the order based on alphabetical comparison. The autoComplete method initiates the auto-complete process by traversing the tree to find words that match the given prefix.</p><pre>class BinarySearchTree {<br>    TreeNode root;<br><br>    public BinarySearchTree() {<br>        root = null;<br>    }<br><br>    public void insert(String word) {<br>        root = insertRec(root, word);<br>    }<br><br>    private TreeNode insertRec(TreeNode root, String word) {<br>        if (root == null) {<br>            return new TreeNode(word);<br>        }<br>        <br>        int comparison = word.compareTo(root.word);<br>        <br>        if (comparison &lt; 0) {<br>            root.left = insertRec(root.left, word);<br>        } else if (comparison &gt; 0) {<br>            root.right = insertRec(root.right, word);<br>        }<br>        <br>        return root;<br>    }<br><br>    public void autoComplete(String prefix) {<br>        autoCompleteRec(root, prefix);<br>    }<br><br>    private void autoCompleteRec(TreeNode root, String prefix) {<br>        if (root == null) {<br>            return;<br>        }<br>        <br>        if (root.word.startsWith(prefix)) {<br>            System.out.println(root.word);<br>        }<br>        <br>        if (prefix.compareTo(root.word) &lt;= 0) {<br>            autoCompleteRec(root.left, prefix);<br>        }<br>        <br>        autoCompleteRec(root.right, prefix);<br>    }<br>}</pre><p>Now in the main method, we add a few words to the tree. Here, for example, I have added only a few words. But in actual implementation in a project, we can add an entire dictionary of words.</p><p>In the example main method, we insert some words into the binary search tree and then call the autoComplete method to generate auto-complete suggestions for a given prefix (to be entered by the user in the console).</p><pre>public class AutoCompleteApp {<br>    public static void main(String[] args) {<br>        BinarySearchTree autoCompleteTree = new BinarySearchTree();<br>        autoCompleteTree.insert(&quot;apple&quot;);<br>        autoCompleteTree.insert(&quot;appetizer&quot;);<br>        autoCompleteTree.insert(&quot;banana&quot;);<br>        autoCompleteTree.insert(&quot;ball&quot;);<br>        autoCompleteTree.insert(&quot;bat&quot;);<br>        autoCompleteTree.insert(&quot;cat&quot;);<br>        autoCompleteTree.insert(&quot;dog&quot;);<br><br>        Scanner scanner = new Scanner(System.in);<br>        System.out.print(&quot;Enter a prefix for auto-complete: &quot;);<br>        String prefix = scanner.nextLine();<br>        <br>        System.out.println(&quot;Auto-complete suggestions:&quot;);<br>        autoCompleteTree.autoComplete(prefix);<br>        scanner.close();<br>    }<br>}</pre><p>Now, when you run the program, it will prompt you to enter a prefix for auto-complete suggestions. After entering the prefix, it will display words that match the prefix in the binary search tree.</p><p>For example, I gave “app” and the results are as shown below</p><pre>Enter a prefix for auto-complete: app<br>Auto-complete suggestions:<br>apple<br>appetizer<br><br>Enter a prefix for auto-complete: ba<br>Auto-complete suggestions:<br>banana<br>ball<br>bat</pre><p>As we wrap up our exploration, remember that the digital landscape continues to evolve, and so do the ways we enhance user experiences. The symbiotic relationship between user needs and technological innovation paves the way for exciting possibilities, where the seamless fusion of binary search trees and auto-complete offers a glimpse into the future of user interaction.</p><p>With BSTs and auto-complete at the forefront, let’s continue to create interfaces that not only meet but exceed user expectations, making every interaction a delight.</p><blockquote>💡Share your insights and experiences in the comments below. Let’s spark a conversation about the future of Java coding!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e876cdf8141" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Beats to Nodes: Building Dynamic Playlists with Linked Lists]]></title>
            <link>https://medium.com/@jahnavivetukuri/from-beats-to-nodes-building-dynamic-playlists-with-linked-lists-6d4a0db12a96?source=rss-c52eea1b11bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d4a0db12a96</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Jahnavi Vetukuri]]></dc:creator>
            <pubDate>Sat, 26 Aug 2023 16:30:14 GMT</pubDate>
            <atom:updated>2023-11-11T12:52:26.642Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In this blog, we delve deep into the realm of dynamic music playlists, uncovering how linked lists empower us to curate personalized musical journeys. We’ll explore how these powerful data structures enable us to add, remove, shuffle, and navigate through songs effortlessly, painting a vivid picture of a playlist that evolves with us.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VeoXVY6Dnl3KPr0rVkLfcA.png" /></figure><p>🎵 <em>Welcome to a journey where code and melodies harmonize seamlessly! In a world where music is the backdrop to our lives, we often find ourselves craving playlists that adapt to our moods and preferences. Enter linked lists, the unsung heroes of data structures, here to revolutionize the way we experience our favourite tunes.</em></p><p>💡 But it’s not just about music; it’s about the art of enhancing user experiences through code. We’ll dissect the principles behind linked lists, unveiling how they seamlessly weave the melodies of code and creativity. Whether you’re a coding enthusiast, a music lover, or both, this blog is your ticket to understanding how technology can amplify the rhythm of our lives.</p><p><strong>The Melodies of Linked Lists</strong></p><p>At its core, a <em>linked list</em> is a data structure that links elements together through nodes. Each node contains both <em>data and a reference</em> to the next node, creating a dynamic sequence. This dynamic nature is what makes linked lists the perfect candidate for crafting music playlists that evolve with our changing preferences.</p><p><strong>Building the Playlist</strong></p><p>Imagine building a playlist of your favourite songs. Each song becomes a node, with its title and artist encapsulated. As you add songs, linked lists ensure that each new track seamlessly links to the previous one, forming a virtual thread of melodies.</p><p>The implementation is shown below</p><pre>class Song {<br>    String title;<br>    String artist;<br><br>    public Song(String title, String artist) {<br>        this.title = title;<br>        this.artist = artist;<br>    }<br><br>    public String toString() {<br>        return title + &quot; by &quot; + artist;<br>    }<br>}<br><br>class Node {<br>    Song song;<br>    Node next;<br><br>    public Node(Song song) {<br>        this.song = song;<br>        this.next = null;<br>    }</pre><p><strong>Dynamic Interactions</strong></p><p>One of the standout features of linked lists is their dynamic interaction. Adding a new song is a matter of creating a new node and updating the previous node’s reference. Removing a song is equally intuitive — simply reconfigure the pointers to skip the undesired node. This dynamic nature allows for efficient playlist management, ensuring a smooth experience even as the playlist grows.</p><p>This feature can be implemented just by using <strong><em>add and delete node</em></strong> operations as shown below</p><pre>//adding a node<br>public void addToPlaylist(Song song) {<br>        Node newNode = new Node(song);<br>        if (head == null) {<br>            head = newNode;<br>        } else {<br>            Node current = head;<br>            while (current.next != null) {<br>                current = current.next;<br>            }<br>            current.next = newNode;<br>        }<br>    }<br>//deleting a node<br>public void removeSong(String title) {<br>        if (head == null) {<br>            return;<br>        }<br>        if (head.song.title.equals(title)) {<br>            head = head.next;<br>            return;<br>        }<br>        Node current = head;<br>        while (current.next != null &amp;&amp; !current.next.song.title.equals(title)) {<br>            current = current.next;<br>        }<br>        if (current.next != null) {<br>            current.next = current.next.next;<br>        }<br>    }</pre><p><strong>Shuffling the Symphony</strong></p><p>Ever had that itch for musical spontaneity? Admit it, we have all been there. Though our playlist contains all our favourite songs, we sometimes want to shuffle it. Linked lists empower us to shuffle our playlists effortlessly. By converting the linked list to an array, shuffling the array, and then reconstructing the linked list, we can create a fresh order of songs, transforming the playlist into a unique musical experience every time.</p><p>The seamless implementation is shown below</p><pre>public void shufflePlaylist() {<br>        if (head == null) {<br>            return;<br>        }<br>        Song[] songs = toArray();<br>        Random random = new Random();<br>        for (int i = songs.length - 1; i &gt; 0; i--) {<br>            int j = random.nextInt(i + 1);<br>            Song temp = songs[i];<br>            songs[i] = songs[j];<br>            songs[j] = temp;<br>        }<br>        head = null;<br>        for (Song song : songs) {<br>            addToPlaylist(song);<br>        }<br>    }</pre><p>The toArray method helps in shuffling the playlist by converting the linked list to an array temporarily.</p><p><strong>Navigating the Tune Trail</strong></p><p>Navigating through the playlist is just as smooth. With linked lists, moving forward or backwards is a matter of following the references. This simple traversal mechanism is at the heart of user-friendly playlist navigation.</p><pre>public void displayPlaylist() {<br>        Node current = head;<br>        while (current != null) {<br>            System.out.println(current.song);<br>            current = current.next;<br>        }<br>    }</pre><p>The entire implementation is coded as shown below</p><pre>import java.util.Random;<br><br>class MusicPlaylist {<br>    private Node head;<br><br>    public void addToPlaylist(Song song) {<br>        Node newNode = new Node(song);<br>        if (head == null) {<br>            head = newNode;<br>        } else {<br>            Node current = head;<br>            while (current.next != null) {<br>                current = current.next;<br>            }<br>            current.next = newNode;<br>        }<br>    }<br><br>    public void removeSong(String title) {<br>        if (head == null) {<br>            return;<br>        }<br>        if (head.song.title.equals(title)) {<br>            head = head.next;<br>            return;<br>        }<br>        Node current = head;<br>        while (current.next != null &amp;&amp; !current.next.song.title.equals(title)) {<br>            current = current.next;<br>        }<br>        if (current.next != null) {<br>            current.next = current.next.next;<br>        }<br>    }<br><br>    public void shufflePlaylist() {<br>        if (head == null) {<br>            return;<br>        }<br>        Song[] songs = toArray();<br>        Random random = new Random();<br>        for (int i = songs.length - 1; i &gt; 0; i--) {<br>            int j = random.nextInt(i + 1);<br>            Song temp = songs[i];<br>            songs[i] = songs[j];<br>            songs[j] = temp;<br>        }<br>        head = null;<br>        for (Song song : songs) {<br>            addToPlaylist(song);<br>        }<br>    }<br><br>    public void displayPlaylist() {<br>        Node current = head;<br>        while (current != null) {<br>            System.out.println(current.song);<br>            current = current.next;<br>        }<br>    }<br><br>    private Song[] toArray() {<br>        Node current = head;<br>        int size = 0;<br>        while (current != null) {<br>            size++;<br>            current = current.next;<br>        }<br>        Song[] songs = new Song[size];<br>        current = head;<br>        int index = 0;<br>        while (current != null) {<br>            songs[index] = current.song;<br>            index++;<br>            current = current.next;<br>        }<br>        return songs;<br>    }<br><br>    public static void main(String[] args) {<br>        MusicPlaylist playlist = new MusicPlaylist();<br>        playlist.addToPlaylist(new Song(&quot;Spring Day&quot;, &quot;BTS&quot;));<br>        playlist.addToPlaylist(new Song(&quot;Wildest Dreams&quot;, &quot;Taylor Swift&quot;));<br>        playlist.addToPlaylist(new Song(&quot;Nee prashnalu neeve&quot;, &quot;SPB&quot;));<br>        playlist.addToPlaylist(new Song(&quot;Who Says&quot;, &quot;Selena Gomez&quot;));<br>        playlist.addToPlaylist(new Song(&quot;People&quot;, &quot;AgustD&quot;));<br><br>        System.out.println(&quot;Current Playlist:&quot;);<br>        playlist.displayPlaylist();<br><br>        playlist.removeSong(&quot;Wildest Dreams&quot;);<br>        System.out.println(&quot;\nPlaylist after removing Wildest Dreams:&quot;);<br>        playlist.displayPlaylist();<br><br>        playlist.shufflePlaylist();<br>        System.out.println(&quot;\nShuffled Playlist:&quot;);<br>        playlist.displayPlaylist();<br>    }<br>}<br><br>class Song {<br>    String title;<br>    String artist;<br><br>    public Song(String title, String artist) {<br>        this.title = title;<br>        this.artist = artist;<br>    }<br><br>    public String toString() {<br>        return title + &quot; by &quot; + artist;<br>    }<br>}<br><br>class Node {<br>    Song song;<br>    Node next;<br><br>    public Node(Song song) {<br>        this.song = song;<br>        this.next = null;<br>    }<br>}</pre><p>In this simplified example, the Song class represents a song with a title and an artist. The Node class represents a node in the linked list, containing a reference to the Song object and the next node. The MusicPlaylist class manages the playlist using a linked list of Node objects.</p><p>The output is shown below</p><pre>Current Playlist:<br>Spring Day by BTS<br>Wildest Dreams by Taylor Swift<br>Nee prashnalu neeve by SPB<br>Who Says by Selena Gomez<br>People by AgustD<br><br>Playlist after removing Wildest Dreams:<br>Spring Day by BTS<br>Nee prashnalu neeve by SPB<br>Who Says by Selena Gomez<br>People by AgustD<br><br>Shuffled Playlist:<br>Nee prashnalu neeve by SPB<br>Spring Day by BTS<br>Who Says by Selena Gomez<br>People by AgustD</pre><p><em>Please note that this is a basic implementation and may need further refinement for more complex scenarios.</em></p><p><strong><em>Beyond Music: The Applications of Linked Lists</em></strong></p><p>While we’ve harmonized linked lists with music playlists, their potential goes beyond the world of melodies. Linked lists are the building blocks for many applications, from managing comment threads on blog posts to implementing undo/redo functionality in software.</p><p><strong><em>In Conclusion</em></strong></p><p>As the curtain falls on our exploration, the melodies of linked lists continue to resonate. They’re not just data structures; they’re the instruments that transform ordinary playlists into dynamic, personalized symphonies. So whether you’re a music enthusiast seeking a new rhythm or a coder weaving melodies through code, linked lists offer a harmonious bridge between the art of music and the science of technology.</p><blockquote>🎶 Let’s celebrate the magic of linked lists — the virtuosos of dynamic playlist creation. Code your rhythm, weave your tunes, and embark on a journey where the harmony of music meets the magic of code! 🎵</blockquote><p><em>💡Share your insights and experiences in the comments below. Let’s spark a conversation about the future of Java coding!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d4a0db12a96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lambda Expressions: Elevating Java Efficiency]]></title>
            <link>https://medium.com/@jahnavivetukuri/lambda-expressions-elevating-java-efficiency-3dfa723494f2?source=rss-c52eea1b11bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dfa723494f2</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jahnavi Vetukuri]]></dc:creator>
            <pubDate>Thu, 17 Aug 2023 11:52:32 GMT</pubDate>
            <atom:updated>2023-11-11T12:58:24.828Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In this blog, we’re diving deep into the world of lambda expressions — a dynamic feature that’s set to transform the way you write Java code.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uNlNKGn62mg2B3_SUemcow.png" /></figure><p>In this blog, you’ll discover:</p><p>🔍 What lambda expressions are and how they work.</p><p>💡 The benefits of using lambdas in your Java projects.</p><p>🌐 Practical examples that showcase lambda power.</p><p>🚀 Tips for when and how to integrate lambdas effectively.</p><p>🌟<strong> Introduction: Unlocking Coding Efficiency</strong></p><p>In the realm of programming, efficiency is the golden key that opens doors to cleaner, more elegant code. Imagine a world where complex operations are expressed in concise, expressive lines, and your focus remains steadfast on the core logic. Enter lambda expressions — Java’s secret weapon to streamline your code and enhance your programming experience.</p><p><strong>Brief Overview of Lambda Expressions</strong></p><p>Lambda expressions are like magic spells that transform your code from verbose to succinct, making it both functional and expressive. These dynamic constructs are designed to empower Java developers by facilitating functional programming paradigms while minimizing code clutter.</p><p><strong>Benefits of Lambda Expressions: A Glimpse into the Magic</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2lk3t6j64Ssp2dfgceAwmQ.png" /></figure><p><strong>Lambda Syntax and Structure:</strong></p><p>Lambda expressions follow a simple structure:</p><pre>(parameters) -&gt; expression or block</pre><p>These expressions often replace the need for separate methods, reducing redundancy and increasing code clarity. It can be used with zero or multiple parameters and even with a return type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gIfH7_WgommloZWkilPeGw.png" /></figure><p>Now let us look into the implementation of each type of Lambda Expression usage with examples</p><p>The below code shows the lambda expression with zero arguments and no return type</p><pre>@FunctionalInterface<br>interface SampleClass{<br> //abstract method without a return type<br> void callMethod();<br>}<br><br>public class LambdaTest {<br> public static void main(String args[]) {<br>  /*Lambda expression without arguments to implement the Functional Interface<br>   This directly implements the abstract method inside the SampleClass <br>  */<br>  SampleClass call = () -&gt; System.out.println(&quot;Method is called&quot;);<br>  /*This calls the Lambda expressions and <br>    executes what is present inside the expression<br>   */<br>  call.callMethod();<br> }<br> <br>}</pre><p>After the execution, the results can be seen below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lnj0THKv2oobNWlvUeNPTA.png" /></figure><p>The code below shows the lambda expression with one argument and no return type</p><pre>@FunctionalInterface<br>interface SampleClass1{<br> //abstract method without a return type<br> void callMethod(int square);<br>}<br><br>public class LambdaWithArguments { <br> <br> public static void main(String args[]) {<br>  int x = 10;<br>  /*Lambda expression with 1 arguments to implement the Functional Interface<br>   This directly implements the abstract method inside the SampleClass <br>  */<br>  SampleClass1 call = (y) -&gt; System.out.println(&quot;Square of &quot;+ x + &quot; is = &quot;+ y*y);<br>  /*This calls the Lambda expressions and <br>    executes what is present inside the expression<br>   */<br>  call.callMethod(x);<br> }<br>}</pre><p>After the execution, the results can be seen below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rca3rhuKN_f183I8kLEDAg.png" /></figure><p>The code below shows the lambda expression with two arguments and a return type</p><pre>@FunctionalInterface<br>interface SampleClass2{<br> //abstract method without a return type<br> int callMethod(int num1, int num2);<br> default void print(int result) {<br>  System.out.println(&quot;Result = &quot;+result);<br> }; <br>}<br>public class LambdaWithTwoArguments { <br> <br> public static void main(String args[]) {<br>  int a = 10 , b =20;<br>  /*Lambda expression with 1 arguments to implement the Functional Interface<br>   This directly implements the abstract method inside the SampleClass <br>  */<br>  SampleClass2 add = (x,y) -&gt; x+y;<br>  //Can create multiple operations using same interface<br>  SampleClass2 multiply = (x,y) -&gt; x*y;<br>  /*This calls the Lambda expressions and <br>    executes what is present inside the expression<br>   */<br>  int addition = add.callMethod(a, b);<br>  int multipl = multiply.callMethod(a,b);<br>  //You may print using the default method like this<br>  add.print(addition);<br>  add.print(multipl);<br>  //Or you may print the result directly<br>  System.out.println(&quot;Addition = &quot; +addition);<br>  System.out.println(&quot;Multiplication = &quot;+multipl);<br> }<br>}</pre><p>After the execution, the results can be seen below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7fI8ylQ4xu9oW0Uv9QGdVw.png" /></figure><p>In the above code, we can see that for the same abstract method, different implementations can be done which reduces the redundancy in creating the methods and their functionality.</p><blockquote><strong>When to Use and When Not to Use Lambdas</strong></blockquote><blockquote>Lambdas excel in situations where simplicity and elegance are valued. They’re perfect for concise operations and functional-style coding. However, when logic becomes intricate and multi-step, traditional methods might offer better clarity.</blockquote><p>Many modern Java APIs are designed to work seamlessly with lambdas. Using Lambdas can make your code more adaptable and align with newer libraries and frameworks.</p><p>Here’s an example of how you can use lambda expressions with Java’s Stream API to filter and process elements in a collection:</p><p>Suppose you have a list of integers and you want to filter out the even numbers which can be implemented using Collections as below</p><pre>import java.util.ArrayList;<br>import java.util.List;<br>import java.util.stream.Collectors;<br><br>public class LambdaCollections {<br> public static void main(String args[]) {<br>  List&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();<br>  list.add(1);<br>  list.add(2);<br>  list.add(3);<br>  list.add(4);<br>  list.add(5);<br>  list.add(6);<br>  list.add(7);<br>  list.add(8);<br>  list.add(9);<br>  list.add(10);<br>  //Printing only even numbers<br>  System.out.println(&quot;Even numbers using for Each = &quot;);<br>  list.forEach(x -&gt; { <br>   if(x%2 ==0) <br>   System.out.println(x);<br>  });<br>  System.out.println(&quot;List = &quot;+list);<br>  //Or you can use stream API directly<br>  System.out.println(&quot;List using Stream API = &quot;);<br>  list.stream().filter(x -&gt; x%2 ==0).collect(Collectors.toList());<br>  System.out.println(list);<br>  <br> }<br>}</pre><p>When implemented, the result is as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZNZu0qqKzb_PC2duggVVg.png" /></figure><p>In this example:</p><ul><li>.stream() converts the list into a stream, allowing for stream operations.</li><li>.filter(num -&gt; num % 2 == 0) filters out the even numbers.</li></ul><p>This approach is concise and expressive, making the code easier to read and understand.</p><p>Lambda expressions shine when combined with the Stream API for operations on collections, allowing you to write complex transformations and filters in a readable and efficient manner.</p><p><strong>Tips for Effective Use: Mastering the Lambda Spell</strong></p><ul><li>Choose descriptive parameter names to enhance readability.</li><li>Keep lambda expressions focused on a single task for maintainability.</li><li>Avoid excessive nesting, ensuring code remains clean and comprehensible.</li></ul><blockquote>💡Share your insights and experiences in the comments below. Let’s spark a conversation about the future of Java coding!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dfa723494f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 2: Mastering Java Basics: Demystifying Data Types, Tokens, and the Main Method]]></title>
            <link>https://medium.com/@jahnavivetukuri/day-2-mastering-java-basics-demystifying-data-types-tokens-and-the-main-method-d2884ba5e3cd?source=rss-c52eea1b11bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2884ba5e3cd</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Jahnavi Vetukuri]]></dc:creator>
            <pubDate>Sat, 12 Aug 2023 12:22:10 GMT</pubDate>
            <atom:updated>2023-11-11T12:57:56.868Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In this blog, we’re breaking down the essentials that form the foundation of Java. Get ready to grasp the fundamental concepts of data types, tokens, and the crucial main method.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D2RdWRcUCnoitG-S40OTPw.png" /></figure><p>If you are new to my blog series, in my previous blog I explained the Java features. You may check it out <a href="https://medium.com/cloudnloud/day-1-exploring-the-power-of-platform-independent-programming-80c95009daa3"><em>here</em></a>.</p><h3><strong>Let&#39;s Begin!</strong></h3><p><strong>Data Types: Knowing Your Data</strong></p><p>Learn about the different types of data in Java, from numbers to characters and more. Understand how to work with variables, and find out why choosing the right data type matters.</p><p>There are two major data types — Primitive data type and Non-Primitive data type</p><p><strong>Primitive data type </strong>— specifies size and value such as <strong>byte, short, int, long, float, double, char and boolean</strong>. They can be initialised and accessed as shown in the program below.</p><p><strong>Non-Primitive data type</strong> — these are derived data types created by users such as <strong>String, Array, Class and Interface etc</strong>. These will be explained in the coming blogs after the object concept is taken</p><p>The visual representation of data types is shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfG8ZFgjxG4mrCUK2uiIaA.png" /></figure><p>Now let us understand how to use the data types in coding</p><pre>public class Hello {<br> public static void main(String args[]) {<br>  <br>  System.out.println(&quot;This is the beginning&quot;);<br>  //Primitive data types<br>  int a = 10; //integer upto 4 bytes<br>  long b = 100; //integer upto 8 bytes<br>  //float size upto 4 bytes. Must end with an f, else it will throw an error<br>  float c = 20.50f; <br>  double d = 20.5434225; //double size upto 8 bytes<br>  char ch = &#39;c&#39;; //char size 2 bytes type must be assigned with a single character/letter or ASCII values with &#39; &#39; <br>  boolean value = true; //size is only 1 bit, value can be assigned as true or false<br>  <br>  System.out.println(a);<br>  System.out.println(b);<br>  System.out.println(c);<br>  System.out.println(d);<br>  System.out.println(ch);<br>  System.out.println(value);    <br> } <br>}</pre><p>The output will be as shown below after the program is run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJ6r43ux7U7Igl1MtavLpw.png" /></figure><p><strong>Tokens: The Puzzle Pieces of Code</strong></p><p>Explore the building blocks of Java code — identifiers, keywords, operators, and more. Discover how they fit together to create meaningful programs.</p><p>The compiler breaks the code into parts of words called tokens. For example, consider the code below</p><pre>public class Hello {<br>   public static void main(String args[]) {<br>      System.out.println(&quot;This is the beginning&quot;);<br>   }<br>}</pre><p>In this <strong><em>public, class, Hello, {, static, void, main, (, String, args[]</em> </strong>etc are the tokens. The tokens are converted into bytecode by the compiler.</p><p><strong>Types of tokens:</strong></p><ol><li><strong><em>Keywords </em></strong>— these are pre-defined reserved words which have a meaning appended to them. They always start with a lowercase letter. Examples include <strong><em>int, char, boolean, if, else, for</em> etc</strong>.</li><li><strong><em>Identifiers </em></strong>— these are the given names by the user for variables, class names, arrays, functions etc. They always start with a lowercase letter or an underscore or a dollar sign but can never start with a digit(can contain digits at a later part). Also, <strong><em>identifiers are case-sensitive</em></strong>.</li><li><strong><em>Literals </em></strong>— represents a <strong><em>fixed value</em></strong>. The value remains constant throughout the program.</li><li><strong><em>Operators </em></strong>— these are special symbols that perform a specific operation. There are arithmetic operators, Relational operators, logical operators etc. (These will be discussed separately)</li><li><strong><em>Separators</em> </strong>— these separate other tokens. For example, <strong>(){}[]|;,.=</strong></li><li><strong><em>Comments </em></strong>— these can be used to specify the information about the code to make it understandable. The <strong><em>compiler treats comments as whitespaces</em></strong>.</li></ol><p><strong>The Main Method: Where It All Begins</strong></p><p>Dive into the main method, the starting point for every Java program. Learn its role in launching your code and interacting with the Java Virtual Machine.</p><p>A word-to-word breakdown with an explanation of the main method is shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mqta-4jV0LBh2uaMnqgiA.png" /></figure><p>If any of these keywords are changed, the compiler throws an error and no output will be shown. Hence it is very important to understand the importance of the main method.</p><p>With a solid understanding of data types, tokens, and the main method, you’ve unlocked the gateway to Java’s world. These essential concepts are your stepping stones towards limitless programming possibilities.</p><p>Whether you’re new to Java or looking to solidify your understanding, this blog will equip you with the basics you need. Stay tuned for more Java insights!</p><p>🙏 Thank you for joining me on this Java journey! Your thoughts matter. Feel free to share your feedback in the comments below. Let’s keep learning and coding together! 🚀🌟</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2884ba5e3cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 1: Exploring the Power of Platform-Independent Programming]]></title>
            <link>https://medium.com/@jahnavivetukuri/day-1-exploring-the-power-of-platform-independent-programming-80c95009daa3?source=rss-c52eea1b11bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/80c95009daa3</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[training]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Jahnavi Vetukuri]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 14:26:25 GMT</pubDate>
            <atom:updated>2023-11-11T12:57:38.789Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZfwOxpLce5gDc2X2JAC_Ig.png" /></figure><p>Java, a high-level, object-oriented programming language, has firmly established itself as a cornerstone of the software development landscape. Developed by Sun Microsystems (now owned by Oracle), Java’s unique characteristics and features have propelled it to be a favourite among programmers worldwide.</p><p><strong>Platform Independence: “Write Once, Run Anywhere”</strong></p><p>One of Java’s defining features is its platform independence. Java programs are compiled into bytecode, which can be executed on any device or operating system with a compatible Java Virtual Machine (JVM). This innovative approach to cross-platform compatibility has earned Java the moniker “write once, run anywhere.” Developers can create software without worrying about the intricacies of the underlying hardware or operating system, a major advantage in the rapidly evolving tech world.</p><p><strong>Object-Oriented Paradigm: Modeling Real-World Concepts</strong></p><p>At the heart of Java lies its strong adherence to the object-oriented programming (OOP) paradigm. In this approach, everything is treated as an object with properties (attributes) and behaviours (methods). This facilitates the creation of modular and reusable code, making development more efficient and maintainable.</p><p><strong>Type Safety and Memory Management: Keeping Errors at Bay</strong></p><p>Java’s strict type-checking during compilation helps prevent errors at runtime, ensuring a higher level of code quality. Moreover, Java features automatic memory management through garbage collection, which relieves developers from the burdens of manual memory allocation and deallocation. This contributes to more stable and efficient programs.</p><p><strong>Security: A Pillar of Java’s Strength</strong></p><p>Java’s security features have solidified its position in building secure applications. Its applet sandboxing mechanism prevents malicious code from causing harm, making Java a reliable choice for applications that prioritize security.</p><p><strong>Java Development Process: From Code to Execution</strong></p><p>The Java development process involves:</p><ol><li>Writing Code: Developers create Java source code files (.java extension) to define program logic.</li><li>Compilation: The Java compiler (javac) transforms source code into bytecode (.class files).</li><li>Execution: The JVM interprets bytecode, enabling the execution of Java programs.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*TTtAcp_ViWZSPNIw_0HNSg.png" /></figure><p><strong>Development Environment: Setting the Stage for Creativity</strong></p><p>To embark on the Java programming journey, two essential components are required:</p><ul><li>Java Development Kit (JDK): Equipped with tools like the Java compiler (javac), the JDK is a prerequisite for Java development.</li><li>Integrated Development Environment (IDE): Popular IDEs such as Eclipse, IntelliJ IDEA, and NetBeans streamline coding, debugging, and project management tasks.</li></ul><p>If you are just trying to practice without the hassle of downloading and setting up the environment, you may opt to practice on “Online Java Compiler”.</p><p>Others, who want to practice dedicatedly and want to further explore web development and explore how the projects are done, may download JDK and IDE. Beginners can download NetBeans or Eclipse installer and it does most of the downloading work for you.</p><p>After the download, you need to make sure to add the Environment variable and Path. In the Windows search bar search for “Environment variable” as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*VxWIPcb_8ZjOVPyeXGV7Ug.png" /></figure><p>Click on “Edit Environment variables”. Now in the dialogue box, click on “Environment Variables”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*Uq9nJSUo6sbPOSZPvVJ7Sg.png" /></figure><p>Now Click on “Path” in the System Variables and click “Edit”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*xGv_zSz-iixuZQ5DjL9zAg.png" /></figure><p>Now click on New and add the Path to the bin folder where your JDK is saved in your System.</p><p>The path to the bin folder is shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*dySXA3DqKkCQcd4BCZM4Vw.png" /></figure><p>Copy the path and add it in the “New” column as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*drbXKOZSTTd6ohyX-akJWg.png" /></figure><p>Now to cross-verify, enter the commands below in your command prompt</p><pre>java --version<br>javac --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*tl9_UwBIVXkiZ1V2H9LLGw.png" /></figure><p>If it executes without errors, then the setup is done. You are good to start coding.</p><p>Now open your IDE and open a new Project “Hello” and create a new Java file.</p><p>Enter the code below and Run it.</p><pre>public class Hello {<br><br>    public static void main(String[] args) {<br>        System.out.println(&quot;This is the beginning&quot;);<br>    }<br>}</pre><p>Voila!! You have started programming in Java. In the coming blog, we will dive into the world of Java by understanding the basics and practice the same simultaneously.</p><p>🙏 Thank you for joining me on this Java journey! Your thoughts matter. Feel free to share your feedback in the comments below. Let’s keep learning and coding together! 🚀🌟</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80c95009daa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>