<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ramya K</title>
    <description>The latest articles on DEV Community by Ramya K (@ramya_kamalasekaran).</description>
    <link>https://dev.to/ramya_kamalasekaran</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2767375%2Fc1fc78f4-b9c0-4c5c-8933-c98d4284ffff.png</url>
      <title>DEV Community: Ramya K</title>
      <link>https://dev.to/ramya_kamalasekaran</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ramya_kamalasekaran"/>
    <language>en</language>
    <item>
      <title>how openai generates images when we integrate with spring boot application</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Wed, 11 Mar 2026 15:41:21 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/how-openai-generates-images-when-we-integrate-with-spring-boot-application-17ea</link>
      <guid>https://dev.to/ramya_kamalasekaran/how-openai-generates-images-when-we-integrate-with-spring-boot-application-17ea</guid>
      <description>&lt;p&gt;When integrating OpenAI with a Spring Boot application,&lt;br&gt;
the image generation process occurs on OpenAI's servers (using models like DALL·E 3), not within your local Spring Boot application itself. Your Spring Boot application acts as a client that sends requests to the OpenAI API. &lt;br&gt;
The interaction typically follows these steps:&lt;br&gt;
    1. User Request: A user interacts with your Spring Boot application (e.g., through a web interface), providing a text prompt and optional parameters (size, quality, style) for the desired image.&lt;br&gt;
    2. API Call: Your Spring Boot application, using either the official OpenAI Java SDK or the Spring AI framework (which abstracts the API calls), makes an authenticated HTTP request to the OpenAI image generation API endpoint.&lt;br&gt;
    3. Authentication: The request includes your secure OpenAI API key in the authorization header to verify your identity and access rights.&lt;br&gt;
    4. OpenAI Processing: OpenAI's servers receive the request. The AI model (like DALL·E 3) processes the text prompt and generates the image using its internal, proprietary systems.&lt;br&gt;
    5. Response Received: OpenAI sends a response back to your Spring Boot application. This response contains either a temporary URL to the generated image or the image data encoded as a Base64 JSON string (b64_json).&lt;br&gt;
    6. Image Handling &amp;amp; Display: Your Spring Boot application receives this response.&lt;br&gt;
        ◦ If a URL is provided, the front end can use this URL to display the image directly (note that these URLs expire after a short period, typically one hour).&lt;br&gt;
        ◦ If b64_json data is received, the application must decode it into an image file format (e.g., PNG) and can store it or serve it to the user.&lt;br&gt;
    7. Persistence (Optional): For long-term storage, your application can save the generated image to a local file system or a cloud storage service like Cloudinary or AWS S3. &lt;/p&gt;

</description>
      <category>ai</category>
      <category>imagegeneration</category>
      <category>springai</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Introduction of Artificial Intelligence</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Fri, 06 Mar 2026 16:35:18 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/introduction-of-artificial-intelligence-1go6</link>
      <guid>https://dev.to/ramya_kamalasekaran/introduction-of-artificial-intelligence-1go6</guid>
      <description>&lt;p&gt;&lt;strong&gt;Artificial Intelligence:&lt;/strong&gt;&lt;br&gt;
Artificial Intelligence is about creating systems that can learn from data &lt;br&gt;
and make intelligent decisions - just like humans but often faster and at a much larger scale.&lt;/p&gt;

&lt;p&gt;It's not magic.&lt;br&gt;
It's not science fiction.&lt;br&gt;
It's advanced math,&lt;br&gt;
massive data,&lt;br&gt;
and smart algorithms working together -&lt;br&gt;
to make our world a little more intelligent.&lt;br&gt;
...........................................&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does AI learn everything?&lt;/strong&gt;&lt;br&gt;
How does it understand language, write code, solve problems, and even think like a human sometimes?&lt;br&gt;
Let's break this down in the simplest way possible.&lt;br&gt;
I doesn't actually know things the way humans do.&lt;br&gt;
It doesn't understand the world emotionally or physically.&lt;br&gt;
It learns by recognizing patterns.&lt;br&gt;
Millions and millions of patterns.&lt;br&gt;
Imagine you are teaching a child what a cat is.&lt;br&gt;
You show them many pictures of cats.&lt;br&gt;
Slowly, their brain learns the patterns.&lt;br&gt;
Two ears, whiskers, four legs,Tail. Now they can recognize a cat in any picture.&lt;/p&gt;

&lt;p&gt;AI learns the same way, but on a much bigger scale.&lt;br&gt;
Instead of seeing ten pictures, it sees millions.&lt;br&gt;
Instead of reading ten sentences, it reads billions.&lt;br&gt;
And every time it sees something, it adjusts tiny internal connections, just like neurons in the human brain.&lt;br&gt;
This process is called training.&lt;/p&gt;

&lt;p&gt;During training, AI looks at data, makes a prediction, compares it to the correct answer, and then adjust itself again and again, sometimes billions of times.&lt;/p&gt;

&lt;p&gt;Over time, these tiny adjustments turn a blank neural network into something incredibly smart. Now the AI can understand meaning, guess context, translate languages, write code, answer questions,&lt;br&gt;
create art, and even make decisions.&lt;br&gt;
But it's important to know this AI does not understand the world.&lt;br&gt;
It understands patterns in data.&lt;br&gt;
So when you ask a question, AI predicts the most likely correct answer based on the patterns it has learned before.&lt;br&gt;
It's like a giant pattern machine, not a human brain.&lt;/p&gt;

&lt;p&gt;Not consciousness. Just prediction at an unbelievable scale.Here's the shocking part.The more data you give AI, the better it gets.&lt;br&gt;
The more powerful the hardware, the faster it learns. This is why modern AI feels almost magical, because it has seen more information than any human ever could.&lt;br&gt;
But even with all this power, AI still needs humans.&lt;br&gt;
Humans decide the goals.&lt;br&gt;
Humans check the accuracy.&lt;br&gt;
Humans provide the data.&lt;br&gt;
Humans set the rules and decide what to build.&lt;/p&gt;

&lt;p&gt;So how does AI learn everything?&lt;br&gt;
By learning from us, from our books, from our code, from our conversations, from the patterns we&lt;br&gt;
create every day.&lt;br&gt;
AI is not a replacement for human intelligence.&lt;br&gt;
It is an amplification of it.&lt;br&gt;
And the people who understand how to use it will shape the future.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>introduction</category>
      <category>works</category>
    </item>
    <item>
      <title>Java 8 -Streams API Few Questions</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Thu, 27 Nov 2025 04:04:26 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/java-8-streams-api-few-questions-3iho</link>
      <guid>https://dev.to/ramya_kamalasekaran/java-8-streams-api-few-questions-3iho</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. Given a list of strings, print them in uppercase in alphabetical order.&lt;/strong&gt;&lt;br&gt;
Explanation: Map each string to uppercase, then sort and print.&lt;br&gt;
Solution (Java):&lt;br&gt;
list.stream()&lt;br&gt;
    .map(String::toUpperCase)&lt;br&gt;
    .sorted()&lt;br&gt;
    .forEach(System.out::println);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Given a list of strings, print them in uppercase by the length of each element.&lt;/strong&gt;&lt;br&gt;
Explanation: Map to uppercase, then sort by length using Comparator.comparingInt.&lt;br&gt;
Solution (Java):&lt;br&gt;
list.stream()&lt;br&gt;
    .map(String::toUpperCase)&lt;br&gt;
    .sorted(Comparator.comparingInt(String::length))&lt;br&gt;
    .forEach(System.out::println);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Given a list of strings, remove null or empty strings from the list.&lt;/strong&gt;&lt;br&gt;
Explanation: Filter out nulls and empty values, collect to a list.&lt;br&gt;
Solution (Java):&lt;br&gt;
List cleaned = list.stream()&lt;br&gt;
    .filter(s -&amp;gt; s != null &amp;amp;&amp;amp; !s.isEmpty())&lt;br&gt;
    .collect(Collectors.toList());&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Given a list of nums, square each number in the list.&lt;/strong&gt;&lt;br&gt;
Explanation: Map each number to its square.&lt;br&gt;
Solution (Java):&lt;br&gt;
List squared = nums.stream()&lt;br&gt;
    .map(n -&amp;gt; n * n)&lt;br&gt;
    .collect(Collectors.toList());&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Given a list of nums, find the largest number in the list.&lt;/strong&gt;&lt;br&gt;
Explanation: Use max with natural ordering.&lt;br&gt;
Solution (Java):&lt;br&gt;
Optional max = nums.stream().max(Integer::compareTo);&lt;br&gt;
int largest = max.orElseThrow(() -&amp;gt; new NoSuchElementException("List empty"));&lt;/p&gt;

</description>
      <category>java</category>
      <category>streams</category>
      <category>advanced</category>
      <category>question</category>
    </item>
    <item>
      <title>Collection Interface - List</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Thu, 27 Nov 2025 04:00:08 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/collection-interface-list-1eo3</link>
      <guid>https://dev.to/ramya_kamalasekaran/collection-interface-list-1eo3</guid>
      <description>&lt;p&gt;**&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhe30etyivebqyaq77twp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhe30etyivebqyaq77twp.jpg" alt=" " width="600" height="522"&gt;&lt;/a&gt; **&lt;br&gt;
The Collection interface is the root interface of the Java Collection Hierarchy. It is located in the java.util package. The Collection interface is not directly implemented by any class. Instead, it is implemented indirectly through its sub-interfaces like List, Queue, and Set.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;List: *&lt;/em&gt;&lt;br&gt;
List is a subinterface of Collection and used when we want to store elements in a specific order and allow duplicates.&lt;/p&gt;

&lt;p&gt;Key Features: &lt;br&gt;
● ✅ Maintains the order of insertion &lt;br&gt;
● ✅ Allows duplicate elements &lt;br&gt;
● ✅ Supports null values (implementation-dependent) &lt;br&gt;
● ✅ Provides index-based access (get, add, set, remove) &lt;br&gt;
● ✅ Includes ListIterator for forward &amp;amp; backward traversal &lt;br&gt;
● ✅ Implementation Classes: - ArrayList - LinkedList - Stack - Vector&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ArrayList:&lt;/strong&gt;&lt;br&gt;
 ArrayList is an implementing class of the List interface. It stores the element dynamically. It maintains insertion order, allows duplicates and null values.&lt;/p&gt;

&lt;p&gt;✅ Key Features: &lt;br&gt;
● Maintains insertion order&lt;br&gt;
● Allows duplicate elements&lt;br&gt;
● Allows null values &lt;br&gt;
● Dynamic resizing (no fixed size)&lt;br&gt;
● Index-based access (get/set)&lt;br&gt;
● Not thread-safe (non synchronized)&lt;/p&gt;

&lt;p&gt;✅ When to Use: &lt;br&gt;
● When fast random access is needed. &lt;br&gt;
● When mostly reading data. &lt;br&gt;
● When adding/removing at the end.&lt;/p&gt;

&lt;p&gt;✅ Important Points to Remember: &lt;br&gt;
● Not suitable for multi-threading (use Collections.synchronizedList() or CopyOnWriteArrayList if needed) &lt;br&gt;
● Faster than LinkedList in access &lt;br&gt;
● Slower than LinkedList in insertion/deletion in the middle &lt;/p&gt;

&lt;p&gt;✅ One-Line Summary: &lt;/p&gt;

&lt;p&gt;ArrayList = Fast access + Dynamic Array + Allows duplicates &amp;amp; nulls + Not thread-safe&lt;/p&gt;

</description>
      <category>collection</category>
      <category>interface</category>
      <category>java</category>
      <category>list</category>
    </item>
    <item>
      <title>Collection framework</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Thu, 27 Nov 2025 03:49:53 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/collection-framework-ak1</link>
      <guid>https://dev.to/ramya_kamalasekaran/collection-framework-ak1</guid>
      <description>&lt;ol&gt;
&lt;li&gt;What is the difference between fail-fast and fail-safe iterators?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;● Fail-fast (like in ArrayList, HashMap) throw ConcurrentModificationException if the collection is modified while iterating.&lt;br&gt;
● Fail-safe (like in CopyOnWriteArrayList, ConcurrentHashMap) operate on a clone, so no exception is thrown.&lt;/p&gt;

&lt;p&gt;🔹 2. Why does HashMap key need equals() and hashCode() methods?&lt;br&gt;
Because keys are stored in buckets based on their hash code.&lt;br&gt;
● hashCode() decides the bucket.&lt;br&gt;
● equals() resolves collisions by comparing actual content.&lt;/p&gt;

&lt;p&gt;🔹3. What happens if two keys have the same hash code in a HashMap?&lt;br&gt;
They go into the same bucket as a linked list (or tree in Java 8+). HashMap then uses equals() to distinguish between them.&lt;/p&gt;

&lt;p&gt;🔹 4. Can we insert null in a HashSet or HashMap?&lt;br&gt;
● HashMap → one null key allowed, multiple null values allowed.&lt;br&gt;
● HashSet → one null element allowed.&lt;br&gt;
● Hashtable and ConcurrentHashMap → do not allow nulls.&lt;/p&gt;

&lt;p&gt;🔹 5. How does HashMap handle rehashing?&lt;br&gt;
When the load factor (default 0.75) is exceeded, it doubles the capacity and rehashes all entries into new buckets.&lt;/p&gt;

&lt;p&gt;🔹 6. What’s the difference between ArrayList and LinkedList in terms of performance?&lt;br&gt;
● ArrayList → faster for random access, slower for insert/delete in middle.&lt;br&gt;
● LinkedList → faster for frequent insert/delete, slower for random access. But in practice, ArrayList is usually preferred due to lower memory overhead.&lt;/p&gt;

&lt;p&gt;🔹 7. How does TreeMap maintain sorting?&lt;br&gt;
It keeps entries sorted according to natural ordering or a custom Comparator. It uses a Red-Black Tree internally.&lt;/p&gt;

&lt;p&gt;🔹 8. What is the difference between Collection and Collections?&lt;br&gt;
● Collection → an interface (List, Set, Queue).&lt;br&gt;
● Collections → a utility class with static methods like sort(), reverse(), shuffle(), etc.&lt;/p&gt;

&lt;p&gt;🔹 9. What is the difference between HashMap and ConcurrentHashMap?&lt;br&gt;
● HashMap→ not thread-safe, can cause data inconsistency.&lt;br&gt;
● ConcurrentHashMap → thread-safe, divides map into segments, no locking of entire map.&lt;/p&gt;

&lt;p&gt;🔹 10. Why compareTo() and equals() must be consistent in sorted collections like TreeSet or TreeMap?&lt;br&gt;
Because if compareTo() says two objects are equal but equals() disagrees, it can break contract — leading to missing or duplicate elements in sorted collections.&lt;/p&gt;

</description>
      <category>java</category>
      <category>collection</category>
      <category>framework</category>
      <category>interview</category>
    </item>
    <item>
      <title>Why Java hashmap uses null key and stores it in 0th index?</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Thu, 27 Nov 2025 03:44:30 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/why-java-hashmap-uses-null-key-and-stores-it-in-0th-index-2890</link>
      <guid>https://dev.to/ramya_kamalasekaran/why-java-hashmap-uses-null-key-and-stores-it-in-0th-index-2890</guid>
      <description>&lt;p&gt;In Java's HashMap, a null key is stored in bucket 0 because the hashCode() method cannot be invoked on a null reference.&lt;br&gt;
When a key-value pair is added to a HashMap, the hashCode() method of the key is typically used to determine the bucket index where the entry will be stored. However, if the key is null, calling null.hashCode() would result in a NullPointerException.&lt;br&gt;
To handle null keys gracefully, HashMap explicitly checks if the key is null. If it is, the HashMap implementation assigns it to a default, fixed location, which is conventionally bucket 0. This allows HashMap to support null keys without encountering runtime errors, and ensures that null keys are consistently placed in a predictable location.&lt;br&gt;
This design choice allows null to serve as a valid key, potentially useful for representing default values or special cases within the map. It is important to note that only one null key can exist in a HashMap at any given time, as keys must be unique.&lt;/p&gt;

</description>
      <category>hashmap</category>
      <category>java</category>
      <category>null</category>
      <category>index</category>
    </item>
    <item>
      <title>Few Java Programs</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Mon, 11 Aug 2025 04:04:35 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/few-java-programs-268g</link>
      <guid>https://dev.to/ramya_kamalasekaran/few-java-programs-268g</guid>
      <description>&lt;p&gt;1.Create a class Trial with PSVM&lt;br&gt;
create an array of names of length 5  -&amp;gt;&lt;br&gt;
 String[] names = new String[5];&lt;br&gt;
get the values using scanner for this&lt;br&gt;
Iterate through the array and print the name starting with r in uppercase&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create 2 classes Student, StudentMain&lt;br&gt;
Student class has studentName,department as properties. Create a parameterised constructor and toString&lt;br&gt;
In StudentMain add PSVM&lt;br&gt;
create an array of Student(array of student objects)&lt;br&gt;
Student[] students = new Student[2];&lt;br&gt;
assign values as &lt;br&gt;
student[0] = new Student("Ram", "ECE");&lt;br&gt;
student[1] = new Student("Raju", "CSE");&lt;br&gt;
Iterate this using foreach and print the student details;&lt;br&gt;
Once done, modify the same with 5 student objects. &lt;br&gt;
use for loop to get values for name and dept to assign to five different student objects&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a two dimensional array of size 3x3 with int values. use for loop to assign values&lt;br&gt;
Iterate through the array to get the even numbers and calculate their sum(use foreach)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a class Project with 2 methods&lt;br&gt;
String[] toolsUsed(){&lt;br&gt;
 //return an array of tools like maven, git, JUnit&lt;br&gt;
}&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;void  printTopics(String[] topicName){&lt;br&gt;
    // iterate the array and print it&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;Create another class ProjectMain. create PSVM &lt;br&gt;
  create one object for Project class and call the methods separately and print . the topic name can be spring, java, react&lt;/p&gt;




&lt;p&gt;package com.first;&lt;/p&gt;

&lt;p&gt;public class Student {&lt;br&gt;
    String studentName;&lt;br&gt;
    String department;&lt;br&gt;
    public Student(String studentName, String department) {&lt;br&gt;
        super();&lt;br&gt;
        this.studentName = studentName;&lt;br&gt;
        this.department = department;&lt;br&gt;
    }&lt;/p&gt;

&lt;p&gt;}&lt;br&gt;
package com.first;&lt;/p&gt;

&lt;p&gt;import java.util.Scanner;&lt;/p&gt;

&lt;p&gt;public class StudentMain {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void main(String[] args) {
    Student[] student=new Student[2];       
    student[0]=new Student("Ram","ECE");
    student[1]=new Student("Raju","CSE");

    for(Student students:student){
        System.out.println(students.studentName+" "+students.department);
    }

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

&lt;/div&gt;
&lt;h2&gt;
  
  
  }
&lt;/h2&gt;

&lt;p&gt;modified 2nd program for 5 students using scanner&lt;/p&gt;

&lt;p&gt;package com.first;&lt;/p&gt;

&lt;p&gt;public class Student {&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;String studentName;
String department;
public Student(String studentName, String department) {
    super();
    this.studentName = studentName;
    this.department = department;
}
@Override
public String toString() {
    return "Student [studentName=" + studentName + ", department=" + department+"]";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;package com.first;&lt;/p&gt;

&lt;p&gt;import java.util.Scanner;&lt;/p&gt;

&lt;p&gt;public class StudentMain {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    Student[] student=new Student[5];   
    for (int i = 0; i &amp;lt; 5; i++) {
        System.out.println("Enter Student Name");
        String studentName=scanner.next();
        System.out.println("Enter department");
        String department=scanner.next();

        student[i]=new Student(studentName,department);
    }

    for(Student students:student){
        System.out.println(students);
    }

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

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;




&lt;p&gt;package practise;&lt;/p&gt;

&lt;p&gt;import java.util.Scanner;&lt;/p&gt;

&lt;p&gt;public class TwoDArrayEvenSum {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        Scanner sc = new Scanner(System.in);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    int[][] matrix = new int[3][3];


    System.out.println("Enter 9 integer values for 3x3 matrix:");
    for (int i = 0; i &amp;lt; 3; i++) {
        for (int j = 0; j &amp;lt; 3; j++) {
            matrix[i][j] = sc.nextInt();
        }
    }


    int evenSum = 0;
    System.out.println("Even numbers in the matrix:");
    for (int[] row : matrix) {
        for (int num : row) {
            if (num % 2 == 0) {
                System.out.print(num + " ");
                evenSum += num;
            }
        }
    }

    System.out.println("Sum of even numbers: " + evenSum);

    sc.close();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;




&lt;p&gt;package com.first;&lt;/p&gt;

&lt;p&gt;public class Project {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static String[] toolsUsed() {
    return new String[] { "maven","git","Junit" };
}
void printTopics(String[] topicName) {      
    for(String topic:topicName){
        System.out.println(topic);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;package com.first;&lt;/p&gt;

&lt;p&gt;public class ProjectMain {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void main(String[] args) {
    System.out.println("Tools");
    String[] tools = Project.toolsUsed();
    for (String tool : tools) {
        System.out.println(tool);
    }
    System.out.println();
    System.out.println("Topics");
    Project project=new Project();
    String[] topics= {"Spring","Java","React"};
    project.printTopics(topics);


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

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

</description>
      <category>java</category>
      <category>array</category>
      <category>string</category>
      <category>constructor</category>
    </item>
    <item>
      <title>Spring Project - Student class</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Tue, 01 Jul 2025 16:31:05 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/spring-project-student-class-j69</link>
      <guid>https://dev.to/ramya_kamalasekaran/spring-project-student-class-j69</guid>
      <description>&lt;p&gt;Step:1. Create New Maven Project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3b3oc509alltvt1qajd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3b3oc509alltvt1qajd.png" alt="Image description" width="376" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step:2. Add this context dependency in pom.xml to create console based spring project&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
    org.springframework&lt;br&gt;
    spring-context&lt;br&gt;
    6.2.7&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Step:3. In Spring Project we need to create Spring IOC container in main method.&lt;br&gt;
ApplicationContext context=new AnnotationConfigApplicationContext(“com.shristi”)&lt;/p&gt;

&lt;p&gt;Step:4. Add the below codes to display student details in main method&lt;br&gt;
public class StudentMain {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void main(String[] args) {
    //create the IOCContainer-
    //spring beans are created
    ApplicationContext context=new AnnotationConfigApplicationContext("com.shristi.constr");
    Student student=(Student) context.getBean("student");
    System.out.println(student);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Step:5. Here the student class has dependency with department class. So autowired department class using Constructor DI. For constructor DI no need to provide @Autowired.&lt;/p&gt;

&lt;p&gt;Step:6. Student Class has following fields- studentName,studentId, city&lt;/p&gt;

&lt;p&gt;Step:7. Department class has following fields- deptId, deptName,deptHead&lt;/p&gt;

&lt;p&gt;Step:8. Here inside in the project explorer java/main/resources folder create application.properties. Instaed of hardcording we can give values here.&lt;/p&gt;

&lt;p&gt;student.studentName="Ramya"&lt;br&gt;
student.studentId=23456&lt;br&gt;
student.city=Chennai&lt;/p&gt;

&lt;p&gt;department.deptId=CSE123&lt;br&gt;
department.deptName="CSE"&lt;br&gt;
department.deptHead="Aditi" &lt;/p&gt;

&lt;p&gt;Step:9. To Access the value in the class use @Value(“${student.studentId}”)&lt;/p&gt;

&lt;p&gt;Step:10. To add application.properties in class use this line in each class.@PropertySource("classpath:application.properties")&lt;/p&gt;

&lt;p&gt;Step:11. Add @Component to create bean in each class if we forgot we get NoSuchBeanDefinitionException&lt;/p&gt;

&lt;p&gt;Step:12. Create paramaterized constructor for department&lt;br&gt;
private Department department;&lt;br&gt;
    //For Constructor based DI no need to provide @Autowired&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public Student(Department department) {
    super();
    this.department = department;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Step:13.create getters and setters method for all fields and toString method too.&lt;/p&gt;

&lt;p&gt;Step:14. If it is SetterBased DI we have to create setter method for dependent class reference no getter method and provide @Autowired on top of it.&lt;/p&gt;

&lt;p&gt;Student.class&lt;br&gt;
package com.shristi.constr;&lt;/p&gt;

&lt;p&gt;import org.springframework.beans.factory.annotation.Value;&lt;br&gt;
import org.springframework.context.annotation.PropertySource;&lt;br&gt;
import org.springframework.stereotype.Component;&lt;br&gt;
@Component&lt;br&gt;
@PropertySource("classpath:application.properties")&lt;br&gt;
public class Student {&lt;br&gt;
    private String studentName;&lt;br&gt;
    private int studentId;&lt;br&gt;
    private String city;&lt;br&gt;
    private Department department;&lt;br&gt;
    //For Constructor based DI no need to provide @Autowired&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public Student(Department department) {
    super();
    this.department = department;
}


public String getStudentName() {
    return studentName;
}

@Value("${student.studentName}")
public void setStudentName(String studentName) {
    this.studentName = studentName;
}


public int getStudentId() {
    return studentId;
}

@Value("${student.studentId}")
public void setStudentId(int studentId) {
    this.studentId = studentId;
}


public String getCity() {
    return city;
}

@Value("${student.city}")
public void setCity(String city) {
    this.city = city;
}


@Override
public String toString() {
    return "Student [studentName=" + studentName + ", studentId=" + studentId + ", city=" + city + ", department="
            + department + "]";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Department.java&lt;br&gt;
package com.shristi.constr;&lt;/p&gt;

&lt;p&gt;import org.springframework.beans.factory.annotation.Value;&lt;br&gt;
import org.springframework.context.annotation.PropertySource;&lt;br&gt;
import org.springframework.stereotype.Component;&lt;br&gt;
@Component&lt;br&gt;
@PropertySource("classpath:application.properties")&lt;br&gt;
public class Department {&lt;br&gt;
    private String deptId;&lt;br&gt;
    private String deptName;&lt;br&gt;
    private String deptHead;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public String getDeptId() {
    return deptId;
}
@Value("${department.deptId}")
public void setDeptId(String deptId) {
    this.deptId = deptId;
}
public String getDeptName() {
    return deptName;
}
@Value("${department.deptName}")
public void setDeptName(String deptName) {
    this.deptName = deptName;
}
public String getDeptHead() {
    return deptHead;
}
@Value("${department.deptHead}")
public void setDeptHead(String deptHead) {
    this.deptHead = deptHead;
}

@Override
public String toString() {
    return "Department [deptId=" + deptId + ", deptName=" + deptName + ", deptHead=" + deptHead + "]";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
Student [studentName="Ramya", studentId=23456, city=Chennai, department=Department [deptId=CSE123, deptName="CSE", deptHead="Aditi"]]&lt;/p&gt;

</description>
      <category>spring</category>
      <category>mavenproject</category>
      <category>springboot</category>
      <category>springcontext</category>
    </item>
    <item>
      <title>How to enable lombok in Spring tool suite?</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Sun, 29 Jun 2025 22:49:07 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/how-to-enable-lombok-in-spring-tool-suite-59l2</link>
      <guid>https://dev.to/ramya_kamalasekaran/how-to-enable-lombok-in-spring-tool-suite-59l2</guid>
      <description>&lt;p&gt;Lombok is used to reduce boiler plate code.&lt;/p&gt;

&lt;p&gt;Step:1.Create project with Lombok as a dependency.&lt;br&gt;
 Step:2 Once it is created open Maven dependency from Project Explorer&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fiu32v4v80h114a1ibl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fiu32v4v80h114a1ibl.png" alt="Image description" width="669" height="651"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step:3. Copy paste that path lombok path in the windows explorer. Find lombok executable file double click it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokknhmq6ftsfashpgph0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokknhmq6ftsfashpgph0.png" alt="Image description" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step:4. Click Specific location and find the springtoolsuite initialization software where you have installed in your system then install then quit Installer&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdyl0d7p3dsqd38lmacjq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdyl0d7p3dsqd38lmacjq.png" alt="Image description" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi55da18ri5rxjb5wv1g7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi55da18ri5rxjb5wv1g7.png" alt="Image description" width="800" height="485"&gt;&lt;/a&gt;&lt;br&gt;
 Step:5. Close and reopen SpringToolSuite(STS) once.&lt;/p&gt;

&lt;p&gt;Now Lombok will work fine in your STS. Without any error it works very well.&lt;/p&gt;

&lt;p&gt;package com.courseapp.model;&lt;/p&gt;

&lt;p&gt;import lombok.AllArgsConstructor;&lt;br&gt;
import lombok.Data;&lt;br&gt;
import lombok.Getter;&lt;br&gt;
import lombok.NoArgsConstructor;&lt;br&gt;
import lombok.Setter;&lt;br&gt;
import lombok.ToString;&lt;/p&gt;

&lt;p&gt;@NoArgsConstructor&lt;br&gt;
@AllArgsConstructor&lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/data"&gt;@data&lt;/a&gt;&lt;br&gt;
//@Getter&lt;br&gt;
//&lt;a class="mentioned-user" href="https://dev.to/setter"&gt;@setter&lt;/a&gt;&lt;br&gt;
//@ToString&lt;br&gt;
public class Course {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private String courseName;
private Integer courseId;
private String type; 
private double cost;
private int durationInWeeks;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

</description>
      <category>lombok</category>
      <category>dependency</category>
      <category>springboot</category>
      <category>spingtoolsuite</category>
    </item>
    <item>
      <title>for vs for-in vs for-of loop in Javascript</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Thu, 26 Jun 2025 21:23:45 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/for-vs-for-in-vs-for-of-loop-in-javascript-1i15</link>
      <guid>https://dev.to/ramya_kamalasekaran/for-vs-for-in-vs-for-of-loop-in-javascript-1i15</guid>
      <description>&lt;p&gt;&lt;strong&gt;for loop for-in loop for-of loop&lt;br&gt;
for loop:&lt;/strong&gt;&lt;br&gt;
We need to provide initialization, condition and increment/decrement to iterate the elements one by one. It is used when the number of iteration is known.&lt;/p&gt;

&lt;p&gt;let a=[10,100,1000];&lt;br&gt;
for(let i=0;i&amp;lt;a.length;i++){&lt;br&gt;
    console.log(a[i]);       &lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;let str="Javascript";&lt;br&gt;
for(let i=0;i&amp;lt;str.length;i++){&lt;br&gt;
    console.log(str[i]);       &lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;for-of:&lt;/strong&gt;&lt;br&gt;
We no need to provide initialization and condition and just follow the syntax to iterate all the elemnts from the array and string. It is used to iterate generator function values too. &lt;br&gt;
//for-of loop&lt;br&gt;
let b=[101,1001,10001];&lt;br&gt;
for(let val of b){&lt;br&gt;
    console.log(val);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;It is used to iterate generator function values too. &lt;br&gt;
function* newgen(){&lt;br&gt;
    yield "one";&lt;br&gt;
    yield "two";&lt;br&gt;
    yield "three";&lt;br&gt;
}&lt;br&gt;
let val=newgen();&lt;br&gt;
for(let gen of val){&lt;br&gt;
    console.log(gen);    &lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;To iterate for and for of values are to be in single values. In object values are in key-value pair so cant iterate using for-of to overcome that for-in loop is used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;for-in:&lt;/strong&gt;&lt;br&gt;
To iterate object values for-in loop is used. Array and string also we can iterate.&lt;/p&gt;

&lt;p&gt;//for-in&lt;br&gt;
// to iterate objects using for-in&lt;br&gt;
let person={&lt;br&gt;
    pname:"AAA",&lt;br&gt;
    age:11,&lt;br&gt;
    sibling:["BB","CC"],&lt;br&gt;
    hobby(){&lt;br&gt;
        console.log("Watching movie");        &lt;br&gt;
    },&lt;br&gt;
    pcolor:{&lt;br&gt;
        hair:"black",&lt;br&gt;
        eye:"blue"&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
for(let key in person ){&lt;br&gt;
    console.log(person[key]);&lt;br&gt;
    &lt;br&gt;
}&lt;br&gt;
// to iterate array using for-in&lt;br&gt;
let arr=["a",'b',"c"];&lt;br&gt;
for(let key in arr){&lt;br&gt;
 console.log(arr[key]);&lt;br&gt;
}&lt;br&gt;
// to iterate string using for-in&lt;br&gt;
let st="Hello";&lt;br&gt;
for(let key in st){&lt;br&gt;
 console.log(st[key]);&lt;br&gt;
}&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>forloop</category>
      <category>forinloop</category>
      <category>forofloop</category>
    </item>
    <item>
      <title>@Autowired in Spring</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Thu, 26 Jun 2025 21:19:07 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/autowired-in-spring-11p2</link>
      <guid>https://dev.to/ramya_kamalasekaran/autowired-in-spring-11p2</guid>
      <description>&lt;p&gt;Autowiring:&lt;br&gt;
Autowiring means wiring the dependency in the particular class by SpringFramework. We give metadata configuration file to the IOC Container, based on the configuration IOC container creates the bean and inject the depenedency. It is achieved by using @Autowired annotation. &lt;/p&gt;

&lt;p&gt;Autowiring is done in 3 ways:&lt;br&gt;
1.Autowiring by Type&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Autowiring by Name
3.Autowiring by Constructor&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note:&lt;br&gt;
When there are multiple beans in same type for autowiring, there will be ambiguity. It will throw NoUniqueBeanDefinitionException.&lt;br&gt;
If we missed to provide @Autowire on top of other class reference, we will get NullpointerException.&lt;/p&gt;

&lt;p&gt;1.Autowiring by Type:&lt;br&gt;
It is achieved through qualifier annotation&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Autowiring by Name:
IOC container will inject the dependency when the instance variable and bean name are same.
So we have to create our own bean name @Component(“shape”) – but it is not recommended.
Otherwise we can have the bean name as reference name&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.Autowiring by constructor:&lt;br&gt;
create reference for the class and create constructor using reference variable.&lt;br&gt;
Add @qualifier(“bean”) inside constructor parameter &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantage of Autowiring:&lt;/strong&gt; It requires less code because we don't need to write the code to inject the dependency explicitly.&lt;br&gt;
&lt;strong&gt;Disadvantage of Autowiring:&lt;/strong&gt; No control of the programmer and It can't be used for primitive and string values.&lt;/p&gt;

&lt;p&gt;The class is not annotated with @component we get NosuchbeanException&lt;/p&gt;

&lt;p&gt;Icourse.java – Interface&lt;br&gt;
package com.shristi.autowire;&lt;/p&gt;

&lt;p&gt;public interface Icourse {&lt;br&gt;
    void show_courses();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;CourseFactory.java&lt;br&gt;
package com.shristi.autowire;&lt;/p&gt;

&lt;p&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;br&gt;
import org.springframework.beans.factory.annotation.Qualifier;&lt;br&gt;
import org.springframework.stereotype.Component;&lt;/p&gt;

&lt;p&gt;@Component&lt;br&gt;
public class CourseFactory {&lt;br&gt;
    @Autowired  //autowire by type&lt;br&gt;
    @Qualifier("frontEnd")&lt;br&gt;
    private Icourse course;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Autowired //autowire by name
private Icourse backEnd;

//autowire by constructor
private Icourse cloud;


public CourseFactory(@Qualifier("cloud")Icourse cloud) {
    super();
    this.cloud = cloud;
}


public void printcourses() {
    course.show_courses();
    backEnd.show_courses();
    cloud.show_courses();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;FrontEnd.java&lt;br&gt;
package com.shristi.autowire;&lt;/p&gt;

&lt;p&gt;import org.springframework.stereotype.Component;&lt;/p&gt;

&lt;p&gt;@Component&lt;br&gt;
public class FrontEnd implements Icourse{&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Override
public void show_courses() {
    System.out.println("HTML,CSS and JS");

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

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Cloud.java&lt;br&gt;
package com.shristi.autowire;&lt;/p&gt;

&lt;p&gt;import org.springframework.stereotype.Component;&lt;/p&gt;

&lt;p&gt;@Component&lt;br&gt;
public class Cloud implements Icourse{&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Override
public void show_courses() {
    // TODO Auto-generated method stub
    System.out.println("AWS");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Backend.Java&lt;br&gt;
package com.shristi.autowire;&lt;/p&gt;

&lt;p&gt;import org.springframework.stereotype.Component;&lt;/p&gt;

&lt;p&gt;@Component&lt;br&gt;
public class BackEnd implements Icourse{&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Override
public void show_courses() {
    // TODO Auto-generated method stub
    System.out.println("JAVA and Springboot");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Automain.java&lt;/p&gt;

&lt;p&gt;package com.shristi.autowire;&lt;/p&gt;

&lt;p&gt;import org.springframework.context.ApplicationContext;&lt;br&gt;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;&lt;/p&gt;

&lt;p&gt;public class Automain {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void main(String[] args) {

    ApplicationContext context=new AnnotationConfigApplicationContext("com.shristi.autowire");
    CourseFactory factory=context.getBean(CourseFactory.class);
    factory.printcourses();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

</description>
      <category>ioc</category>
      <category>autowiring</category>
      <category>spring</category>
      <category>dependencyinjection</category>
    </item>
    <item>
      <title>Javascript Variables and operators</title>
      <dc:creator>Ramya K</dc:creator>
      <pubDate>Fri, 20 Jun 2025 14:23:08 +0000</pubDate>
      <link>https://dev.to/ramya_kamalasekaran/javascript-variables-and-operators-5j6</link>
      <guid>https://dev.to/ramya_kamalasekaran/javascript-variables-and-operators-5j6</guid>
      <description>&lt;p&gt;&lt;strong&gt;Variables:&lt;/strong&gt;&lt;br&gt;
It is a container to store values or it is named memory location.&lt;br&gt;
it is also called as identifier or reference variable.&lt;br&gt;
It varies value so it is called variable.&lt;br&gt;
a=10;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rules for creating variable name:&lt;/strong&gt;&lt;br&gt;
1.Each variable has unique name and case sensitive.&lt;br&gt;
2.It can start with letter, $ and _ and not with number.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It should not use reserved words.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Naming convention:&lt;/strong&gt;&lt;br&gt;
camel case- variable name and function name follows- employeeId&lt;br&gt;
Pascal case- class and Interfaces follows- Employee&lt;br&gt;
under case- employee_Id&lt;/p&gt;

&lt;p&gt;keywords which are used to declare variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;let _– when we assign the value to the variablei.e during declaration we give let a=10; 
re declaration is not allowed. 
Reassignment a=15 is allowed
*_const _– re-declartion and reassignment both not allowed
*_var&lt;/em&gt; – it is legacy keyword not recommended to use. It allows both re declaration and reassignment. 
var a=10;
var a=15;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To see the output of the js ie. console use(ctrl+shift+i) or right click on the browser webpage and inspect&lt;/p&gt;

&lt;p&gt;if we reassign or redeclare the const, we will get error&lt;br&gt;
Printing multiple variable by comma separation:&lt;br&gt;
let a=10;&lt;br&gt;
let b=15;&lt;br&gt;
we can print more that one variable by comma separation&lt;br&gt;
console.log(a,b);&lt;/p&gt;

&lt;p&gt;printing statements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;alert(“hi”) or we can pass variable alert(a) – one button- ok&lt;/li&gt;
&lt;li&gt;confirm(“hi”) – same as alert but in confirm there will be 2 buttons- ok and cancel&lt;/li&gt;
&lt;li&gt;document.write() or writeln- prints in UI&lt;/li&gt;
&lt;li&gt;prompt(“enter the num”)- used to get input dynamically from user
let num=prompt(“enter the num”)
console.log(num)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;different methods in console:&lt;br&gt;
let a;&lt;br&gt;
1.console.log(a)- undefined – variable is declared but initialized means we get undefined value.&lt;br&gt;
2.console.error(a)-displays undefined as error&lt;br&gt;
3.console.warn(a)-displays undefined as warning&lt;br&gt;
4.console.clear()- clears all the printed msg&lt;/p&gt;

&lt;p&gt;Operator: &lt;br&gt;
It is used to perform operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Operators:&lt;/strong&gt;&lt;br&gt;
1.Arithmetic operator&lt;br&gt;
2.Comparison operator or Relational operator&lt;br&gt;
3.Assignment operator&lt;br&gt;
4.Logical operator&lt;br&gt;
5.Bitwise operator&lt;br&gt;
6.Ternary operator&lt;br&gt;
7.unary operator&lt;/p&gt;

&lt;p&gt;1.Arithmetic operator:&lt;br&gt;
It is used to perform arithmetic operations.Operator: &lt;br&gt;
It is used to perform operations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;(addition)&lt;/li&gt;
&lt;li&gt;(subtraction)&lt;/li&gt;
&lt;li&gt;(multiplication)
/ (division)
% (modulus - remainder of division)
** (exponentiation - ES2016)
++ (increment)
-- (decrement)&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Assignment operator:&lt;br&gt;
Assign values to variables.&lt;/p&gt;

&lt;p&gt;= (assignment)&lt;br&gt;
+= (addition assignment)&lt;br&gt;
-= (subtraction assignment)&lt;br&gt;
&lt;em&gt;= (multiplication assignment)&lt;br&gt;
/= (division assignment)&lt;br&gt;
%= (modulus assignment)&lt;br&gt;
*&lt;/em&gt;= (exponentiation assignment)&lt;br&gt;
assigning right hand value to left hand variable.&lt;br&gt;
+= -= &lt;em&gt;= /= %= *&lt;/em&gt;=&lt;br&gt;
assigning value to the same variable.&lt;br&gt;
a=a+1&lt;br&gt;
a+=1, a-=1&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.Comparison or relational operator:&lt;br&gt;
compares 2 values and returns boolean value(true or false)&lt;br&gt;
== (equality)&lt;br&gt;
!= (inequality)&lt;br&gt;
=== (strict equality - checks value and type)&lt;br&gt;
!== (strict inequality)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;(greater than)&lt;br&gt;
&amp;lt; (less than)&lt;br&gt;
= (greater than or equal to)&lt;br&gt;
&amp;lt;= (less than or equal to)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;4.Logical operator:&lt;br&gt;
Combine or manipulate Boolean expressions.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;amp;&amp;amp; (logical AND)
|| (logical OR)
! (logical NOT)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Concatenation (+)&lt;br&gt;
    Combining more than one string is called concatenation.&lt;br&gt;
This is just like java concatenation.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
let num=5;&lt;br&gt;
 let first=1;&lt;br&gt;
console.log(num+”*”+first”=”num*first)&lt;/p&gt;

&lt;p&gt;To ease the string concatenation template string is introduced since ES6 version.&lt;/p&gt;

&lt;p&gt;Template string or Template literal:&lt;/p&gt;

&lt;p&gt;Here we use `` backtick and to get the value of the variable inside backtick use ${}. &lt;/p&gt;

</description>
      <category>variables</category>
      <category>varconstlet</category>
      <category>javascript</category>
      <category>operators</category>
    </item>
  </channel>
</rss>
