<?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: Karthick Karthick</title>
    <description>The latest articles on DEV Community by Karthick Karthick (@karthick_karthick_bf8338d).</description>
    <link>https://dev.to/karthick_karthick_bf8338d</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3691172%2F24e86427-b825-4652-b5f6-5507458d7771.png</url>
      <title>DEV Community: Karthick Karthick</title>
      <link>https://dev.to/karthick_karthick_bf8338d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karthick_karthick_bf8338d"/>
    <language>en</language>
    <item>
      <title>"Why Can't the Main Class Be Protected in Java? Understanding Access Rules and Inheritance"</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Sat, 13 Jun 2026 06:18:41 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/why-cant-the-main-class-be-protected-in-java-understanding-access-rules-and-inheritance-5a2e</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/why-cant-the-main-class-be-protected-in-java-understanding-access-rules-and-inheritance-5a2e</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;In Java, access modifiers define the visibility and accessibility of classes, methods, and variables. A common question among beginners is "Why can't a main class be declared as protected?" The answer lies in Java's rules for top-level classes and access control&lt;/p&gt;

&lt;p&gt;Can a Top-Level Class Be protected?&lt;/p&gt;

&lt;p&gt;No. A top-level class (a class declared directly inside a .java file) cannot be declared as protected.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;protected class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        System.out.println("Hello Java");&lt;br&gt;
    }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Why Is protected Not Allowed for the Main Class?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;protected Works Through Inheritance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The protected access modifier is designed to allow access:&lt;/p&gt;

&lt;p&gt;Inside the same package.&lt;br&gt;
In child classes (subclasses), even if they are in different packages.&lt;/p&gt;

&lt;p&gt;A top-level class does not have a parent class that needs to control access through inheritance, so protected has no meaningful purpose for it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Java Allows Only public or Default for Top-Level Classes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java language rules allow only two access levels for top-level classes:&lt;/p&gt;

&lt;p&gt;public → Accessible from anywhere.&lt;br&gt;
default (no modifier) → Accessible only within the same package.&lt;/p&gt;

&lt;p&gt;private and protected are only allowed for class members or nested classes.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;JVM Must Be Able to Locate the Main Class&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When a Java program starts, the JVM needs to load the class containing the main() method.&lt;/p&gt;

&lt;p&gt;A top-level class must follow Java's accessibility rules, which means it can be public or default, but not protected.&lt;/p&gt;

&lt;p&gt;Can a Nested Class Be protected?&lt;/p&gt;

&lt;p&gt;Yes. A class declared inside another class (nested class) can use the protected access modifier.&lt;br&gt;
`class Outer {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;protected class Inner {
    void display() {
        System.out.println("Protected Nested Class");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

</description>
      <category>beginners</category>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>"Why Can't the Main Class Be Private in Java? Understanding Access Rules and JVM Execution"</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Sat, 13 Jun 2026 06:14:11 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/why-cant-the-main-class-be-private-in-java-understanding-access-rules-and-jvm-execution-3jp1</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/why-cant-the-main-class-be-private-in-java-understanding-access-rules-and-jvm-execution-3jp1</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Java, access modifiers control the visibility of classes, methods, and variables. One common question among beginners is "Why can't a main class be private?" Understanding this requires knowledge of how the Java compiler and Java Virtual Machine (JVM) access classes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a Main Class in Java?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A main class is the class that contains the main() method, which serves as the entry point of a Java application.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        System.out.println("Hello Java");&lt;br&gt;
    }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Why Can't a Top-Level Class Be Private?&lt;/p&gt;

&lt;p&gt;In Java, a top-level class (a class declared directly in a file, not inside another class) can only have two access modifiers:&lt;/p&gt;

&lt;p&gt;public&lt;br&gt;
Default (no access modifier)&lt;/p&gt;

&lt;p&gt;A top-level class cannot be&lt;/p&gt;

&lt;p&gt;&lt;code&gt;private class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        System.out.println("Hello Java");&lt;br&gt;
    }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Why Is private Not Allowed for the Main Class?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Private Means Restricted Access&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A private class can only be accessed within its enclosing class. Since a top-level class has no enclosing class, making it private would make no practical sense.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;JVM Needs Access to the Class&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you run a Java program, the JVM needs to locate and load the class containing the main() method. If the main class were private, external code would not be able to access it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Java Follows Access Control Rules&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java's access modifiers are designed to control visibility:&lt;/p&gt;

&lt;p&gt;public → Accessible from anywhere.&lt;br&gt;
Default → Accessible within the same package.&lt;br&gt;
private → Accessible only inside the same class.&lt;br&gt;
protected → Accessible within the package and subclasses.&lt;/p&gt;

&lt;p&gt;Since a top-level class is not inside another class, private and protected are not applicable.&lt;/p&gt;

&lt;p&gt;Can the main() Method Be Private?&lt;/p&gt;

&lt;p&gt;No. The main() method must be declared as public static void main(String[] args).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;public class Main {&lt;br&gt;
    private static void main(String[] args) {&lt;br&gt;
        System.out.println("Hello");&lt;br&gt;
    }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can a Main Class Have Default Access?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. A main class can have default (package-private) access.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        System.out.println("Java Program");&lt;br&gt;
    }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding Polymorphism in Java: Types, Examples, and Real-Time Applications</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Sat, 13 Jun 2026 06:00:40 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/understanding-polymorphism-in-java-types-examples-and-real-time-applications-2in0</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/understanding-polymorphism-in-java-types-examples-and-real-time-applications-2in0</guid>
      <description>&lt;p&gt;&lt;strong&gt;Polymorphism in Java: A Complete Beginner's Guide&lt;br&gt;
Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Polymorphism is one of the four main principles of Object-Oriented Programming (OOP) in Java. The word Polymorphism comes from two Greek words: "Poly" meaning many and "Morph" meaning forms. It allows a single entity such as a method or object to take multiple forms.&lt;/p&gt;

&lt;p&gt;In simple words, one name can have many behaviors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Polymorphism in Java?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Polymorphism is the ability of an object or method to perform different actions based on the situation. It enables Java to use a single interface to represent different implementations.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Why Do We Need Polymorphism?&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Polymorphism is used to make programs more flexible, reusable, and easy to maintain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reasons for Using Polymorphism:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code Reusability&lt;/li&gt;
&lt;li&gt;The same method name can be reused for different tasks.&lt;/li&gt;
&lt;li&gt;Flexibility&lt;/li&gt;
&lt;li&gt;Allows one interface to work with multiple implementations.&lt;/li&gt;
&lt;li&gt;Easy Maintenance&lt;/li&gt;
&lt;li&gt;Changes can be made in one part of the program without affecting the entire application.&lt;/li&gt;
&lt;li&gt;Extensibility&lt;/li&gt;
&lt;li&gt;New classes and functionalities can be added easily.&lt;/li&gt;
&lt;li&gt;Improved Readability&lt;/li&gt;
&lt;li&gt;Makes the code cleaner and easier to understand.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Types of Polymorphism in Java:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compile-Time Polymorphism&lt;/li&gt;
&lt;li&gt;Runtime Polymorphism&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Compile-Time Polymorphism&lt;/strong&gt; (Static Polymorphism)&lt;/p&gt;

&lt;p&gt;Compile-time polymorphism is achieved through Method Overloading. The compiler decides which method to call based on the number or type of parameters.&lt;br&gt;
`class Calculator {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int add(int a, int b) {
    return a + b;
}

int add(int a, int b, int c) {
    return a + b + c;
}

double add(double a, double b) {
    return a + b;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Calculator obj = new Calculator();

    System.out.println(obj.add(10, 20));
    System.out.println(obj.add(10, 20, 30));
    System.out.println(obj.add(10.5, 20.5));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;&lt;strong&gt;Runtime Polymorphism&lt;/strong&gt; (Dynamic Polymorphism)&lt;/p&gt;

&lt;p&gt;Runtime polymorphism is achieved through Method Overriding. The method that gets executed is determined at runtime based on the actual object.&lt;br&gt;
`class Animal {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void sound() {
    System.out.println("Animal makes a sound");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;class Dog extends Animal {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Override
void sound() {
    System.out.println("Dog barks");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Animal obj = new Dog(); // Upcasting

    obj.sound();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;&lt;strong&gt;Advantages of Polymorphism&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increases code reusability&lt;/li&gt;
&lt;li&gt;Provides flexibility&lt;/li&gt;
&lt;li&gt;Improves scalability&lt;/li&gt;
&lt;li&gt;Makes applications easier to maintain&lt;/li&gt;
&lt;li&gt;Supports dynamic method execution&lt;/li&gt;
&lt;li&gt;Reduces code complexit&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Java Explained: Who Created It, Why It Was Developed, and Why It Is So Popular</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Sat, 13 Jun 2026 05:44:35 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/java-explained-who-created-it-why-it-was-developed-and-why-it-is-so-popular-49b5</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/java-explained-who-created-it-why-it-was-developed-and-why-it-is-so-popular-49b5</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is the Full Form of Java?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java does not have any official full form. It is simply a name chosen for the programming language. Many people jokingly expand it as "Just Another Virtual Accelerator (JAVA)", but this is not an official meaning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Was It Named Java? Who Named It?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java was developed by James Gosling and his team at Sun Microsystems.&lt;/li&gt;
&lt;li&gt;Initially, the language was named Oak because an oak tree stood outside James Gosling’s office.&lt;/li&gt;
&lt;li&gt;Later, the name Oak could not be used because it was already trademarked by another company.&lt;/li&gt;
&lt;li&gt;The team selected the name Java, inspired by Java coffee (coffee beans from the Indonesian island of Java).&lt;/li&gt;
&lt;li&gt;The name was chosen during a team discussion while they were drinking coffee&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Was Java Created?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java was created in 1991 under a project called the Green Project at Sun Microsystems.&lt;/p&gt;

&lt;p&gt;The main goals were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Platform Independence&lt;/li&gt;
&lt;li&gt;A program should run on different devices without rewriting the code.&lt;/li&gt;
&lt;li&gt;Simple and Easy to Learn&lt;/li&gt;
&lt;li&gt;Java was designed with a syntax similar to C and C++ but removed complex features like manual memory management.&lt;/li&gt;
&lt;li&gt;Secure Programming&lt;/li&gt;
&lt;li&gt;It included features like bytecode verification and controlled memory access.&lt;/li&gt;
&lt;li&gt;Support for Different Devices&lt;/li&gt;
&lt;li&gt;Originally, it was created for consumer electronic devices such as televisions and embedded systems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Is Java Efficient?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java became popular because it provides a balance between performance, simplicity, and security.&lt;/p&gt;

&lt;p&gt;Reasons for Java’s Efficiency&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Platform Independence&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java follows the principle "Write Once, Run Anywhere" because programs run on the Java Virtual Machine (JVM).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Automatic Memory Management&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java has Garbage Collection, which automatically removes unused objects and manages memory.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Just-In-Time (JIT) Compilation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The JVM converts frequently used bytecode into native machine code, improving execution speed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Object-Oriented Design&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java provides reusable and maintainable code using classes, objects, inheritance, and polymorphism.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Strong Security&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Features like bytecode verification, access control, and the JVM sandbox improve application security.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Large Community and Ecosystem&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java has a huge developer community, many libraries, frameworks, and tools.Why Is Java Efficient?&lt;/p&gt;

&lt;p&gt;Java became popular because it provides a balance between performance, simplicity, and security.&lt;/p&gt;

&lt;p&gt;Reasons for Java’s Efficiency&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Platform Independence&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java follows the principle "Write Once, Run Anywhere" because programs run on the Java Virtual Machine (JVM).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Automatic Memory Management&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java has Garbage Collection, which automatically removes unused objects and manages memory.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Just-In-Time (JIT) Compilation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The JVM converts frequently used bytecode into native machine code, improving execution speed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Object-Oriented Design&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java provides reusable and maintainable code using classes, objects, inheritance, and polymorphism.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Strong Security&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Features like bytecode verification, access control, and the JVM sandbox improve application security.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Large Community and Ecosystem&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java has a huge developer community, many libraries, frameworks, and tools.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>computerscience</category>
      <category>java</category>
      <category>programming</category>
    </item>
    <item>
      <title>Inheritance in Java: Types, Examples, Advantages, and Complete Guide for Beginners</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Sat, 13 Jun 2026 05:33:58 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/inheritance-in-java-types-examples-advantages-and-complete-guide-for-beginners-39g4</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/inheritance-in-java-types-examples-advantages-and-complete-guide-for-beginners-39g4</guid>
      <description>&lt;p&gt;Inheritance in Java: A Complete Beginner's Guide&lt;br&gt;
Introduction&lt;/p&gt;

&lt;p&gt;Inheritance is one of the fundamental concepts of Object-Oriented Programming (OOP) in Java. It allows one class to acquire the properties and behaviors (variables and methods) of another class. Inheritance promotes code reusability, maintainability, and supports runtime polymorphism.&lt;/p&gt;

&lt;p&gt;What is Inheritance in Java?&lt;/p&gt;

&lt;p&gt;Inheritance is a mechanism where one class (called the child class or subclass) inherits the fields and methods of another class (called the parent class or superclass) using the extends keyword.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;/p&gt;

&lt;p&gt;`class Parent {&lt;br&gt;
    // Variables and methods&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;class Child extends Parent {&lt;br&gt;
    // Additional features&lt;br&gt;
}`&lt;/p&gt;

&lt;p&gt;Types of Inheritance in Java:&lt;/p&gt;

&lt;p&gt;Single Inheritance&lt;br&gt;
Multilevel Inheritance&lt;br&gt;
Hierarchical Inheritance&lt;br&gt;
Multiple Inheritance (Not Supported with Classes)&lt;br&gt;
Hybrid Inheritance&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Single Inheritance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A child class inherits from one parent class&lt;/p&gt;

&lt;p&gt;`class Animal {&lt;br&gt;
    void eat() {}&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;class Dog extends Animal {&lt;br&gt;
    void bark() {}&lt;br&gt;
}`&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Multilevel Inheritance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A class inherits from another child class, forming a chain.&lt;/p&gt;

&lt;p&gt;`class Animal {&lt;br&gt;
    void eat() {}&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;class Dog extends Animal {&lt;br&gt;
    void bark() {}&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;class Puppy extends Dog {&lt;br&gt;
    void weep() {}&lt;br&gt;
}`&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hierarchical Inheritance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Multiple child classes inherit from a single parent class&lt;/p&gt;

&lt;p&gt;`class Animal {&lt;br&gt;
    void eat() {}&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;class Dog extends Animal {&lt;br&gt;
    void bark() {}&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;class Cat extends Animal {&lt;br&gt;
    void meow() {}&lt;br&gt;
}`&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Multiple Inheritance (Not Supported with Classes)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In multiple inheritance, one child class inherits from multiple parent classes.&lt;/p&gt;

&lt;p&gt;`interface A {&lt;br&gt;
    void show();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;interface B {&lt;br&gt;
    void display();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;class C implements A, B {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public void show() {
    System.out.println("Show");
}

public void display() {
    System.out.println("Display");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;ol&gt;
&lt;li&gt;Hybrid Inheritance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hybrid inheritance is a combination of two or more types of inheritance.&lt;/p&gt;

&lt;p&gt;Java does not support hybrid inheritance using classes because it includes multiple inheritance.&lt;/p&gt;

&lt;p&gt;However, it can be achieved using interfaces.&lt;/p&gt;

&lt;p&gt;Advantages of Inheritance&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code Reusability – Write common code once and reuse it.&lt;/li&gt;
&lt;li&gt;Method Overriding – Allows runtime polymorphism.&lt;/li&gt;
&lt;li&gt;Better Code Organization – Creates a logical class hierarchy.&lt;/li&gt;
&lt;li&gt;Easy Maintenance – Changes in the parent class can be reused by child classes&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding Access Modifiers in Java: Public, Private, Protected, and Default Explained</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Sat, 13 Jun 2026 05:25:37 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/understanding-access-modifiers-in-java-public-private-protected-and-default-explained-2j9e</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/understanding-access-modifiers-in-java-public-private-protected-and-default-explained-2j9e</guid>
      <description>&lt;p&gt;&lt;strong&gt;Access Modifiers in Java: A Complete Beginner's Guide&lt;br&gt;
Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Access modifiers in Java are keywords that control the visibility and accessibility of classes, variables, methods, and constructors. They provide encapsulation and help protect data by restricting unauthorized access from other parts of a program.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Access Modifiers in Java?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Access modifiers define who can access a particular class member (variable, method, or constructor). Java provides four types of access modifiers:&lt;/p&gt;

&lt;p&gt;public&lt;br&gt;
private&lt;br&gt;
protected&lt;br&gt;
default (no modifier)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Public Access Modifier&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The public access modifier allows a class, method, or variable to be accessed from anywhere in the program, even from different packages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Private Access Modifier&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The private access modifier allows access only within the same class. It cannot be accessed directly from outside the class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Protected Access Modifier&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The protected modifier allows access within the same package and by subclasses (child classes), even if they are in different packages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;. Default Access Modifier&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When no access modifier is specified, it is called default or package-private access. It can be accessed only within the same package.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why are Access Modifiers Used?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To protect sensitive data.&lt;/li&gt;
&lt;li&gt;To implement encapsulation.&lt;/li&gt;
&lt;li&gt;To control the visibility of classes and class members.&lt;/li&gt;
&lt;li&gt;To improve code security and maintainability.&lt;/li&gt;
&lt;li&gt;To prevent accidental modification of data&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>What is Java? History, Uses, Datatypes, Variables, and OOP Concepts Explained</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Mon, 01 Jun 2026 17:19:37 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/what-is-java-history-uses-datatypes-variables-and-oop-concepts-explained-35g0</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/what-is-java-history-uses-datatypes-variables-and-oop-concepts-explained-35g0</guid>
      <description>&lt;p&gt;What is Java? Why is it Used? How Was It Created? Datatypes and Variables in Java&lt;br&gt;
Introduction&lt;br&gt;
Java is one of the most popular programming languages in the world. It is widely used for developing web applications, desktop software, mobile applications, enterprise systems, and cloud-based solutions. Java follows the principle:&lt;br&gt;
"Write Once, Run Anywhere (WORA)"&lt;br&gt;
This means Java programs can run on different operating systems without modifying the code.&lt;br&gt;
What is Java?&lt;br&gt;
Java is a high-level, object-oriented, platform-independent programming language developed by James Gosling and his team at Sun Microsystems in 1995.&lt;br&gt;
Java code is compiled into bytecode, which runs on the Java Virtual Machine (JVM). This allows Java applications to work on Windows, Linux, macOS, and many other platforms.&lt;br&gt;
Simple Java Program&lt;br&gt;
Java&lt;br&gt;
public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        System.out.println("Hello, Java!");&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
Output&lt;/p&gt;

&lt;p&gt;Hello, Java!&lt;br&gt;
Why is Java Used?&lt;br&gt;
Java is popular because it offers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Platform Independence
Java programs can run on any device with a JVM.&lt;/li&gt;
&lt;li&gt;Object-Oriented Programming
Java uses classes and objects, making applications easier to develop and maintain.&lt;/li&gt;
&lt;li&gt;Security
Java provides built-in security features and memory management.&lt;/li&gt;
&lt;li&gt;High Performance
The JVM uses Just-In-Time (JIT) compilation to improve execution speed.&lt;/li&gt;
&lt;li&gt;Large Community Support
Millions of developers use Java worldwide.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enterprise Applications&lt;br&gt;
Large companies use Java for banking, e-commerce, and business applications.&lt;br&gt;
How Was Java Created?&lt;br&gt;
In 1991, a team led by James Gosling at Sun Microsystems started a project called Green Project.&lt;br&gt;
Evolution of Java&lt;br&gt;
Year&lt;br&gt;
Event&lt;br&gt;
1991&lt;br&gt;
Green Project Started&lt;br&gt;
1994&lt;br&gt;
Language renamed to Java&lt;br&gt;
1995&lt;br&gt;
Java officially released&lt;br&gt;
2010&lt;br&gt;
Sun Microsystems acquired by Oracle Corporation&lt;br&gt;
Present&lt;br&gt;
Java remains one of the most used languages&lt;br&gt;
How Many Days Does It Take to Learn Java?&lt;br&gt;
Learning time depends on your experience and dedication.&lt;br&gt;
Beginner Roadmap&lt;br&gt;
Level&lt;br&gt;
Time Required&lt;br&gt;
Java Basics&lt;br&gt;
2–3 Weeks&lt;br&gt;
OOP Concepts&lt;br&gt;
2 Weeks&lt;br&gt;
Collections &amp;amp; Exception Handling&lt;br&gt;
2 Weeks&lt;br&gt;
JDBC &amp;amp; Database&lt;br&gt;
1–2 Weeks&lt;br&gt;
Advanced Java&lt;br&gt;
3–4 Weeks&lt;br&gt;
Projects Practice&lt;br&gt;
Ongoing&lt;br&gt;
Recommended Timeline&lt;br&gt;
1 Hour Daily → 3–4 Months&lt;br&gt;
2–3 Hours Daily → 1–2 Months&lt;br&gt;
4+ Hours Daily → 3–6 Weeks&lt;br&gt;
Datatypes in Java&lt;br&gt;
A datatype specifies the type of data a variable can store.&lt;br&gt;
Java has 8 Primitive Datatypes.&lt;br&gt;
Datatype&lt;br&gt;
Size&lt;br&gt;
Example&lt;br&gt;
byte&lt;br&gt;
1 byte&lt;br&gt;
100&lt;br&gt;
short&lt;br&gt;
2 bytes&lt;br&gt;
20000&lt;br&gt;
int&lt;br&gt;
4 bytes&lt;br&gt;
50000&lt;br&gt;
long&lt;br&gt;
8 bytes&lt;br&gt;
100000L&lt;br&gt;
float&lt;br&gt;
4 bytes&lt;br&gt;
10.5f&lt;br&gt;
double&lt;br&gt;
8 bytes&lt;br&gt;
20.55&lt;br&gt;
char&lt;br&gt;
2 bytes&lt;br&gt;
'A'&lt;br&gt;
boolean&lt;br&gt;
1 bit&lt;br&gt;
true&lt;br&gt;
Example&lt;br&gt;
Java&lt;br&gt;
public class DataTypes {&lt;br&gt;
public static void main(String[] args) {&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int age = 21;
double salary = 50000.50;
char grade = 'A';
boolean isStudent = true;

System.out.println(age);
System.out.println(salary);
System.out.println(grade);
System.out.println(isStudent);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;br&gt;
}&lt;br&gt;
Output&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;21&lt;br&gt;
50000.5&lt;br&gt;
A&lt;br&gt;
true&lt;br&gt;
Non-Primitive Datatypes&lt;br&gt;
These are created by programmers or provided by Java libraries.&lt;br&gt;
String&lt;br&gt;
Arrays&lt;br&gt;
Classes&lt;br&gt;
Interfaces&lt;br&gt;
Objects&lt;br&gt;
Example&lt;br&gt;
Java&lt;br&gt;
String name = "Ak";&lt;br&gt;
Variables in Java&lt;br&gt;
A variable is a container used to store data values.&lt;br&gt;
Syntax&lt;br&gt;
Java&lt;br&gt;
datatype variableName = value;&lt;br&gt;
Example&lt;br&gt;
Java&lt;br&gt;
int age = 21;&lt;br&gt;
String name = "Ak";&lt;br&gt;
Types of Variables in Java&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Local Variable
Declared inside a method.
Java
public void display() {
int num = 10;
}&lt;/li&gt;
&lt;li&gt;Instance Variable
Declared inside a class but outside methods.
Java
class Student {
int id;
}
Each object gets its own copy.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Static Variable&lt;br&gt;
Declared using the static keyword.&lt;br&gt;
Java&lt;br&gt;
class Student {&lt;br&gt;
static String college = "ABC College";&lt;br&gt;
}&lt;br&gt;
Shared by all objects.&lt;br&gt;
Method Overloading Example&lt;br&gt;
Method Overloading allows multiple methods with the same name but different parameters.&lt;br&gt;
Java&lt;br&gt;
class Calculator {&lt;/p&gt;

&lt;p&gt;int add(int a, int b) {&lt;br&gt;
    return a + b;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;int add(int a, int b, int c) {&lt;br&gt;
    return a + b + c;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;double add(double a, double b) {&lt;br&gt;
    return a + b;&lt;br&gt;
}&lt;br&gt;
}&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Calculator obj = new Calculator();

    System.out.println(obj.add(10, 20));
    System.out.println(obj.add(10, 20, 30));
    System.out.println(obj.add(10.5, 20.5));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
Output&lt;/p&gt;

&lt;p&gt;30&lt;br&gt;
60&lt;br&gt;
31.0&lt;br&gt;
Conclusion&lt;br&gt;
Java is a powerful, secure, and platform-independent programming language used for building everything from mobile applications to enterprise software. By understanding Java's history, uses, datatypes, variables, and method overloading concepts, beginners can build a strong foundation for learning advanced Java topics such as OOP, Collections, JDBC, Spring Boot, and Full Stack Development.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Mastering React Through a Quiz Application Project</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Mon, 01 Jun 2026 17:02:11 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/mastering-react-through-a-quiz-application-project-4nj7</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/mastering-react-through-a-quiz-application-project-4nj7</guid>
      <description>&lt;p&gt;Building a Quiz Application in React Using useState, useEffect, useContext, and useNavigate&lt;/p&gt;

&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;Quiz applications are one of the best beginner-to-intermediate React projects because they demonstrate important React concepts such as state management, component communication, routing, and side effects.&lt;/p&gt;

&lt;p&gt;In this project, I developed a Quiz Application using React and implemented several powerful hooks including useState, useEffect, useContext, and useNavigate. The application allows users to answer questions, track scores, navigate between pages, and view results dynamically.&lt;/p&gt;




&lt;p&gt;Project Overview&lt;/p&gt;

&lt;p&gt;The Quiz Application consists of the following features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Home Page&lt;/li&gt;
&lt;li&gt;Quiz Page&lt;/li&gt;
&lt;li&gt;Multiple Choice Questions&lt;/li&gt;
&lt;li&gt;Score Tracking&lt;/li&gt;
&lt;li&gt;Result Page&lt;/li&gt;
&lt;li&gt;Dynamic Navigation&lt;/li&gt;
&lt;li&gt;Global State Management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Users start the quiz, answer questions one by one, and receive their final score at the end.&lt;/p&gt;




&lt;p&gt;Technologies Used&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React.js&lt;/li&gt;
&lt;li&gt;JavaScript (ES6+)&lt;/li&gt;
&lt;li&gt;HTML5&lt;/li&gt;
&lt;li&gt;CSS3&lt;/li&gt;
&lt;li&gt;React Router DOM&lt;/li&gt;
&lt;li&gt;React Hooks&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Application Workflow&lt;/p&gt;

&lt;p&gt;Step 1: Start Quiz&lt;/p&gt;

&lt;p&gt;The user lands on the home page and clicks the "Start Quiz" button.&lt;/p&gt;

&lt;p&gt;Step 2: Answer Questions&lt;/p&gt;

&lt;p&gt;Questions are displayed one at a time with multiple options.&lt;/p&gt;

&lt;p&gt;Step 3: Score Calculation&lt;/p&gt;

&lt;p&gt;The application checks whether the selected answer is correct and updates the score.&lt;/p&gt;

&lt;p&gt;Step 4: View Results&lt;/p&gt;

&lt;p&gt;After completing all questions, the user is redirected to the results page where the final score is displayed.&lt;/p&gt;




&lt;p&gt;useState Hook&lt;/p&gt;

&lt;p&gt;Purpose&lt;/p&gt;

&lt;p&gt;The useState Hook is used to manage local component state.&lt;/p&gt;

&lt;p&gt;How It Was Used&lt;/p&gt;

&lt;p&gt;In the Quiz Application, useState manages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Current Question Index&lt;/li&gt;
&lt;li&gt;Selected Answer&lt;/li&gt;
&lt;li&gt;User Score&lt;/li&gt;
&lt;li&gt;Quiz Completion Status&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;const [score, setScore] = useState(0);&lt;br&gt;
const [currentQuestion, setCurrentQuestion] = useState(0);&lt;/p&gt;

&lt;p&gt;Benefits&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic UI updates&lt;/li&gt;
&lt;li&gt;Easy state management&lt;/li&gt;
&lt;li&gt;Interactive user experience&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;useEffect Hook&lt;/p&gt;

&lt;p&gt;Purpose&lt;/p&gt;

&lt;p&gt;The useEffect Hook is used to perform side effects in React components.&lt;/p&gt;

&lt;p&gt;How It Was Used&lt;/p&gt;

&lt;p&gt;In the Quiz Application, useEffect helps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load quiz data&lt;/li&gt;
&lt;li&gt;Monitor question changes&lt;/li&gt;
&lt;li&gt;Execute actions when the quiz ends&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
  console.log("Question Changed");&lt;br&gt;
}, [currentQuestion]);&lt;/p&gt;

&lt;p&gt;Benefits&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Handles lifecycle events&lt;/li&gt;
&lt;li&gt;Improves application responsiveness&lt;/li&gt;
&lt;li&gt;Executes logic automatically when dependencies change&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;useContext Hook&lt;/p&gt;

&lt;p&gt;Purpose&lt;/p&gt;

&lt;p&gt;The useContext Hook allows sharing data across multiple components without passing props manually.&lt;/p&gt;

&lt;p&gt;How It Was Used&lt;/p&gt;

&lt;p&gt;A Quiz Context was created to store:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User Score&lt;/li&gt;
&lt;li&gt;Quiz Questions&lt;/li&gt;
&lt;li&gt;Current Progress&lt;/li&gt;
&lt;li&gt;Quiz Status&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;const QuizContext = createContext();&lt;/p&gt;

&lt;p&gt;const value = {&lt;br&gt;
  score,&lt;br&gt;
  setScore&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;Accessing Context:&lt;/p&gt;

&lt;p&gt;const { score } = useContext(QuizContext);&lt;/p&gt;

&lt;p&gt;Benefits&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Eliminates prop drilling&lt;/li&gt;
&lt;li&gt;Centralized state management&lt;/li&gt;
&lt;li&gt;Cleaner component structure&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;useNavigate Hook&lt;/p&gt;

&lt;p&gt;Purpose&lt;/p&gt;

&lt;p&gt;The useNavigate Hook is provided by React Router and enables programmatic navigation.&lt;/p&gt;

&lt;p&gt;How It Was Used&lt;/p&gt;

&lt;p&gt;The application navigates users between pages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Home → Quiz&lt;/li&gt;
&lt;li&gt;Quiz → Results&lt;/li&gt;
&lt;li&gt;Results → Home&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;const navigate = useNavigate();&lt;/p&gt;

&lt;p&gt;navigate("/quiz");&lt;/p&gt;

&lt;p&gt;Benefits&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smooth page transitions&lt;/li&gt;
&lt;li&gt;Better user experience&lt;/li&gt;
&lt;li&gt;Dynamic routing control&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Project Structure&lt;/p&gt;

&lt;p&gt;src/&lt;br&gt;
│&lt;br&gt;
├── components/&lt;br&gt;
│   ├── Home.jsx&lt;br&gt;
│   ├── Quiz.jsx&lt;br&gt;
│   └── Result.jsx&lt;br&gt;
│&lt;br&gt;
├── context/&lt;br&gt;
│   └── QuizContext.jsx&lt;br&gt;
│&lt;br&gt;
├── data/&lt;br&gt;
│   └── questions.js&lt;br&gt;
│&lt;br&gt;
├── App.jsx&lt;br&gt;
└── main.jsx&lt;/p&gt;




&lt;p&gt;Challenges Faced&lt;/p&gt;

&lt;p&gt;State Synchronization&lt;/p&gt;

&lt;p&gt;Managing score updates across components required proper state management.&lt;/p&gt;

&lt;p&gt;Navigation Flow&lt;/p&gt;

&lt;p&gt;Ensuring users could not access the results page before completing the quiz required route control.&lt;/p&gt;

&lt;p&gt;Context Management&lt;/p&gt;

&lt;p&gt;Sharing data globally without prop drilling was solved using useContext.&lt;/p&gt;




&lt;p&gt;Key Learning Outcomes&lt;/p&gt;

&lt;p&gt;Through this project, I learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React Component Architecture&lt;/li&gt;
&lt;li&gt;State Management with useState&lt;/li&gt;
&lt;li&gt;Side Effects with useEffect&lt;/li&gt;
&lt;li&gt;Global Data Sharing with useContext&lt;/li&gt;
&lt;li&gt;Routing with useNavigate&lt;/li&gt;
&lt;li&gt;Building Real-World React Applications&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Future Improvements&lt;/p&gt;

&lt;p&gt;Possible enhancements include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timer-based quizzes&lt;/li&gt;
&lt;li&gt;Difficulty Levels&lt;/li&gt;
&lt;li&gt;Leaderboard System&lt;/li&gt;
&lt;li&gt;User Authentication&lt;/li&gt;
&lt;li&gt;Database Integration&lt;/li&gt;
&lt;li&gt;Category-Based Questions&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;The Quiz Application is an excellent React project that demonstrates practical usage of useState, useEffect, useContext, and useNavigate. These hooks work together to create a dynamic, responsive, and user-friendly application. Building this project helped strengthen my understanding of React fundamentals and provided hands-on experience with real-world development concepts.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>React.js Complete Guide: What It Is, Why It’s Used, Who Created It, and Essential Hooks</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Mon, 01 Jun 2026 16:51:07 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/reactjs-complete-guide-what-it-is-why-its-used-who-created-it-and-essential-hooks-3obc</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/reactjs-complete-guide-what-it-is-why-its-used-who-created-it-and-essential-hooks-3obc</guid>
      <description>&lt;p&gt;What is React? Why is it Used? Who Created It? And Understanding React Hooks&lt;/p&gt;

&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;React is one of the most popular JavaScript libraries used for building modern web applications. From social media platforms to e-commerce websites, React powers thousands of applications worldwide because of its speed, flexibility, and component-based architecture.&lt;/p&gt;

&lt;p&gt;In this article, we will explore what React is, why it is used, who created it, and some of the most important React Hooks such as useState, useEffect, useContext, useNavigate, useReducer, useRef, useMemo, and useCallback.&lt;/p&gt;




&lt;p&gt;What is React?&lt;/p&gt;

&lt;p&gt;React is an open-source JavaScript library used for building user interfaces (UI), especially for Single Page Applications (SPAs).&lt;/p&gt;

&lt;p&gt;Instead of updating an entire webpage, React updates only the parts of the page that change, making applications faster and more efficient.&lt;/p&gt;

&lt;p&gt;Key Features of React&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Component-Based Architecture&lt;/li&gt;
&lt;li&gt;Virtual DOM&lt;/li&gt;
&lt;li&gt;Reusable Components&lt;/li&gt;
&lt;li&gt;One-Way Data Binding&lt;/li&gt;
&lt;li&gt;Fast Rendering&lt;/li&gt;
&lt;li&gt;Large Community Support&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Who Created React?&lt;/p&gt;

&lt;p&gt;React was created by , a software engineer at "about.meta.com" (&lt;a href="https://reference-url-citation.invalid/1" rel="noopener noreferrer"&gt;https://reference-url-citation.invalid/1&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Timeline&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2011 – React was first used internally by Facebook.&lt;/li&gt;
&lt;li&gt;2012 – Used in Instagram.&lt;/li&gt;
&lt;li&gt;2013 – Released as an open-source project.&lt;/li&gt;
&lt;li&gt;Today – Used by companies around the world.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Why is React Used?&lt;/p&gt;

&lt;p&gt;React became popular because it solves many challenges in traditional web development.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reusable Components&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Developers can create a component once and use it multiple times.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;function Welcome() {&lt;br&gt;
  return &lt;/p&gt;
&lt;h1&gt;Welcome User&lt;/h1&gt;;&lt;br&gt;
}



&lt;ol&gt;
&lt;li&gt;Better Performance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;React uses a Virtual DOM to update only changed elements instead of refreshing the entire page.&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;Easy Maintenance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Applications are divided into smaller components, making code easier to manage.&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;Strong Community Support&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Millions of developers contribute tutorials, libraries, and tools.&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;Rich Ecosystem&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;React works well with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redux&lt;/li&gt;
&lt;li&gt;React Router&lt;/li&gt;
&lt;li&gt;Axios&lt;/li&gt;
&lt;li&gt;Firebase&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;What are React Hooks?&lt;/p&gt;

&lt;p&gt;Hooks are special functions introduced in React 16.8 that allow developers to use state and other React features inside functional components.&lt;/p&gt;

&lt;p&gt;Before Hooks, these features were available only in class components.&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;useState Hook&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The useState Hook is used to manage state in functional components.&lt;/p&gt;

&lt;p&gt;Syntax&lt;/p&gt;

&lt;p&gt;const [count, setCount] = useState(0);&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;import { useState } from "react";&lt;/p&gt;

&lt;p&gt;function Counter() {&lt;br&gt;
  const [count, setCount] = useState(0);&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
    &amp;lt;&amp;gt;&lt;br&gt;
      &lt;/p&gt;
&lt;h2&gt;{count}&lt;/h2&gt;
&lt;br&gt;
       setCount(count + 1)}&amp;gt;&lt;br&gt;
        Increment&lt;br&gt;
      &lt;br&gt;
    &amp;lt;/&amp;gt;&lt;br&gt;
  );&lt;br&gt;
}

&lt;p&gt;Use Cases&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Counter applications&lt;/li&gt;
&lt;li&gt;Form handling&lt;/li&gt;
&lt;li&gt;Toggle buttons&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;
&lt;li&gt;useEffect Hook&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The useEffect Hook is used to perform side effects.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API Calls&lt;/li&gt;
&lt;li&gt;Timers&lt;/li&gt;
&lt;li&gt;Event Listeners&lt;/li&gt;
&lt;li&gt;Updating Document Title&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;import { useEffect } from "react";&lt;/p&gt;

&lt;p&gt;function App() {&lt;br&gt;
  useEffect(() =&amp;gt; {&lt;br&gt;
    console.log("Component Mounted");&lt;br&gt;
  }, []);&lt;/p&gt;

&lt;p&gt;return &lt;/p&gt;
&lt;h1&gt;Hello React&lt;/h1&gt;;&lt;br&gt;
}

&lt;p&gt;Use Cases&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetching data&lt;/li&gt;
&lt;li&gt;Browser events&lt;/li&gt;
&lt;li&gt;Synchronizing external systems&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;
&lt;li&gt;useContext Hook&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The useContext Hook allows data sharing across multiple components without prop drilling.&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;const UserContext = createContext();&lt;/p&gt;

&lt;p&gt;function Home() {&lt;br&gt;
  const user = useContext(UserContext);&lt;/p&gt;

&lt;p&gt;return &lt;/p&gt;
&lt;h1&gt;{user}&lt;/h1&gt;;&lt;br&gt;
}

&lt;p&gt;Use Cases&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Theme management&lt;/li&gt;
&lt;li&gt;Language settings&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;
&lt;li&gt;useNavigate Hook&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The useNavigate Hook is provided by React Router.&lt;/p&gt;

&lt;p&gt;It allows navigation between pages programmatically.&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;import { useNavigate } from "react-router-dom";&lt;/p&gt;

&lt;p&gt;function Home() {&lt;br&gt;
  const navigate = useNavigate();&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
     navigate("/about")}&amp;gt;&lt;br&gt;
      Go To About&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Use Cases&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login redirection&lt;/li&gt;
&lt;li&gt;Navigation after form submission&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;
&lt;li&gt;useReducer Hook&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;useReducer is used for complex state management.&lt;/p&gt;

&lt;p&gt;Syntax&lt;/p&gt;

&lt;p&gt;const [state, dispatch] = useReducer(reducer, initialState);&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;function reducer(state, action) {&lt;br&gt;
  switch(action.type) {&lt;br&gt;
    case "increment":&lt;br&gt;
      return { count: state.count + 1 };&lt;br&gt;
    default:&lt;br&gt;
      return state;&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Use Cases&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shopping carts&lt;/li&gt;
&lt;li&gt;Dashboards&lt;/li&gt;
&lt;li&gt;Complex forms&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;
&lt;li&gt;useRef Hook&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;useRef creates a mutable reference that persists across renders.&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;import { useRef } from "react";&lt;/p&gt;

&lt;p&gt;function InputFocus() {&lt;br&gt;
  const inputRef = useRef();&lt;/p&gt;

&lt;p&gt;const focusInput = () =&amp;gt; {&lt;br&gt;
    inputRef.current.focus();&lt;br&gt;
  };&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
    &amp;lt;&amp;gt;&lt;br&gt;
      &lt;br&gt;
      Focus&lt;br&gt;
    &amp;lt;/&amp;gt;&lt;br&gt;
  );&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Use Cases&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DOM access&lt;/li&gt;
&lt;li&gt;Focus management&lt;/li&gt;
&lt;li&gt;Storing previous values&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;
&lt;li&gt;useMemo Hook&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;useMemo is used to optimize performance by memoizing expensive calculations.&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;const result = useMemo(() =&amp;gt; {&lt;br&gt;
  return heavyCalculation(data);&lt;br&gt;
}, [data]);&lt;/p&gt;

&lt;p&gt;Use Cases&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Large datasets&lt;/li&gt;
&lt;li&gt;Filtering operations&lt;/li&gt;
&lt;li&gt;Expensive calculations&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;
&lt;li&gt;useCallback Hook&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;useCallback memoizes functions to prevent unnecessary re-creation.&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;const handleClick = useCallback(() =&amp;gt; {&lt;br&gt;
  console.log("Clicked");&lt;br&gt;
}, []);&lt;/p&gt;

&lt;p&gt;Use Cases&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Optimizing child components&lt;/li&gt;
&lt;li&gt;Preventing unnecessary renders&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Difference Between useMemo and useCallback&lt;/p&gt;

&lt;p&gt;useMemo| useCallback&lt;br&gt;
Memoizes values| Memoizes functions&lt;br&gt;
Returns computed value| Returns function&lt;br&gt;
Used for calculations| Used for event handlers&lt;/p&gt;




&lt;p&gt;Advantages of React&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast Performance&lt;/li&gt;
&lt;li&gt;Reusable Components&lt;/li&gt;
&lt;li&gt;Easy Learning Curve&lt;/li&gt;
&lt;li&gt;Strong Community&lt;/li&gt;
&lt;li&gt;Rich Ecosystem&lt;/li&gt;
&lt;li&gt;SEO Friendly&lt;/li&gt;
&lt;li&gt;Scalable Applications&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Understanding Compile-Time Polymorphism in Java</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Mon, 01 Jun 2026 16:49:17 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/understanding-compile-time-polymorphism-in-java-3eo8</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/understanding-compile-time-polymorphism-in-java-3eo8</guid>
      <description>&lt;p&gt;Compile-Time Polymorphism in Java&lt;br&gt;
&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
Polymorphism is one of the most important concepts in Java. The word "polymorphism" comes from two Greek words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Poly = Many&lt;br&gt;
Morph = Forms&lt;br&gt;
It allows a single method or object to behave in different ways.&lt;br&gt;
Compile-Time Polymorphism is a type of polymorphism where the method to be executed is determined by the compiler during compilation.&lt;br&gt;
&lt;u&gt;It is also known as:&lt;br&gt;
Static Polymorphism&lt;/u&gt;&lt;br&gt;
Early Binding&lt;br&gt;
Method Overloading&lt;br&gt;
What is Compile-Time Polymorphism?&lt;br&gt;
Compile-Time Polymorphism occurs when multiple methods have the same name but different parameter lists. The compiler decides which method should be called based on the arguments passed.&lt;br&gt;
class Calculator {&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int add(int a, int b) {
    return a + b;
}

double add(double a, double b) {
    return a + b;
}

int add(int a, int b, int c) {
    return a + b + c;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Calculator c = new Calculator();

    System.out.println(c.add(10, 20));
    System.out.println(c.add(10.5, 20.5));
    System.out.println(c.add(10, 20, 30));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
Output:&lt;br&gt;
30&lt;br&gt;
31.0&lt;br&gt;
60&lt;/p&gt;

&lt;p&gt;Method Overloading Rules:&lt;br&gt;
Number of Parameters Changes&lt;br&gt;
Data Type Changes&lt;br&gt;
Order of Parameters Changes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages of Compile-Time Polymorphism&lt;/strong&gt;&lt;br&gt;
Code Reusability&lt;br&gt;
Same method name can perform similar tasks.&lt;br&gt;
Readability&lt;br&gt;
Program becomes easier to understand.&lt;br&gt;
Flexibility&lt;br&gt;
Methods can handle different types of input.&lt;br&gt;
Faster Execution&lt;br&gt;
Method calls are resolved during compilation.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>java</category>
      <category>polymorphism</category>
    </item>
    <item>
      <title>React vs JavaScript: Why Developers Prefer React for UI Projects</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Tue, 07 Apr 2026 06:01:23 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/react-vs-javascript-why-developers-prefer-react-for-ui-projects-4g00</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/react-vs-javascript-why-developers-prefer-react-for-ui-projects-4g00</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’ve ever built a small project like a calculator, to-do app, or counter, you might have noticed something interesting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The same app feels harder in JavaScript&lt;/li&gt;
&lt;li&gt;But feels easier in React
At first, this sounds confusing…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Because React is built on JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So how can something built on JavaScript feel easier than JavaScript itself?&lt;/p&gt;

&lt;p&gt;Let’s break it down like a real content creator would — simple, clear, and practical &lt;br&gt;
The Core Idea (Understand This First)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript = You control everything manually&lt;/li&gt;
&lt;li&gt;React = You describe what you want, React handles the rest&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Building a Calculator in JavaScript (What Actually Happens)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you build a calculator using plain JavaScript, you usually:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select buttons using DOM (getElementById, querySelector)&lt;/li&gt;
&lt;li&gt;Add event listeners to every button&lt;/li&gt;
&lt;li&gt;Store values (current number, operator, result)&lt;/li&gt;
&lt;li&gt;Manually update the display&lt;/li&gt;
&lt;li&gt;Handle edge cases (clear, delete, decimal, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reality:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You are doing two jobs at the same time&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Business logic (calculations)&lt;br&gt;
UI updates (changing what user sees)&lt;/p&gt;

&lt;p&gt;That’s why it feels complex.&lt;/p&gt;

&lt;p&gt;Building the Same Calculator in React&lt;/p&gt;

&lt;p&gt;In React, things change completely.&lt;/p&gt;

&lt;p&gt;You:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create components (Button, Display, Calculator)&lt;/li&gt;
&lt;li&gt;Store values in state&lt;/li&gt;
&lt;li&gt;Update state on click&lt;/li&gt;
&lt;li&gt;React updates the UI automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reality:&lt;/p&gt;

&lt;p&gt;You only focus on:&lt;/p&gt;

&lt;p&gt;“What is my data?”&lt;br&gt;
“What should UI show?”&lt;/p&gt;

&lt;p&gt;&lt;u&gt;React handles everything else.&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Why React Feels Easier:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components = Clean Structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In React, everything is divided into small parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Display&lt;/li&gt;
&lt;li&gt;Buttons&lt;/li&gt;
&lt;li&gt;Calculator Logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each part has its own job&lt;/p&gt;

&lt;p&gt;In JavaScript:&lt;/p&gt;

&lt;p&gt;Everything is often mixed together&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State = Easy Data Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React uses state to store changing values.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Current number&lt;/li&gt;
&lt;li&gt;Previous number&lt;/li&gt;
&lt;li&gt;Operator&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When state changes → UI updates automatically&lt;/p&gt;

&lt;p&gt;In JavaScript:&lt;/p&gt;

&lt;p&gt;You must update variables AND update UI manually&lt;/p&gt;

&lt;p&gt;No More Manual DOM Work&lt;/p&gt;

&lt;p&gt;In JavaScript:&lt;/p&gt;

&lt;p&gt;document.getElementById(...)&lt;br&gt;
innerText = value&lt;/p&gt;

&lt;p&gt;In React:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Just update state&lt;/li&gt;
&lt;li&gt;React updates UI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This saves a LOT of effort&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reusability is Super Easy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;Button value="1" /&amp;gt;&lt;br&gt;
&amp;lt;Button value="2" /&amp;gt;&lt;br&gt;
&amp;lt;Button value="+" /&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Better for Bigger Projects&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Small apps → JavaScript is fine&lt;br&gt;
Big apps → React is powerful&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;E-commerce&lt;/li&gt;
&lt;li&gt;Dashboards&lt;/li&gt;
&lt;li&gt;Chat apps&lt;/li&gt;
&lt;li&gt;Payment systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;React keeps things organized&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>ui</category>
      <category>webdev</category>
    </item>
    <item>
      <title>API in JavaScript: Connecting Your Code to the World</title>
      <dc:creator>Karthick Karthick</dc:creator>
      <pubDate>Wed, 01 Apr 2026 05:46:18 +0000</pubDate>
      <link>https://dev.to/karthick_karthick_bf8338d/api-in-javascript-connecting-your-code-to-the-world-3p3</link>
      <guid>https://dev.to/karthick_karthick_bf8338d/api-in-javascript-connecting-your-code-to-the-world-3p3</guid>
      <description>&lt;p&gt;An API (Application Programming Interface) in JavaScript is a way for your code to communicate with other software, services, or systems.&lt;/p&gt;

&lt;p&gt;In simple words:&lt;br&gt;
API = Bridge between your JavaScript and external data/services&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%2Fqfd00xgb36ymrytwh7na.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%2Fqfd00xgb36ymrytwh7na.png" alt=" " width="800" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Real-Time Example&lt;/p&gt;

&lt;p&gt;In Pharmacy E-Commerce :&lt;/p&gt;

&lt;p&gt;User clicks “Buy Now”&lt;br&gt;
 JS sends request to payment API (like Razorpay)&lt;br&gt;
 API processes payment&lt;br&gt;
 JS gets response → shows Success / Failed&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%2Ffrk4cwol1judh4ttf4tv.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%2Ffrk4cwol1judh4ttf4tv.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;API Methods in JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GET (Read Data)&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Used to fetch data from server&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.example.com/products&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;POST (Create Data)&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Used to send new data to server&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.example.com/products&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Tablet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PUT (Update Full Data)&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Used to update entire data&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.example.com/products/1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;PUT&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Tablet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PATCH (Update Partial Data)&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Used to update only specific fields&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.example.com/products/1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;PATCH&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;DELETE (Remove Data)&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Used to delete data&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.example.com/products/1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DELETE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fe4oaq0q3aeg3i9fldrna.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%2Fe4oaq0q3aeg3i9fldrna.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of APIs in JavaScript (Quick View)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Browser APIs → DOM, Geolocation&lt;/li&gt;
&lt;li&gt;Third-party APIs → Payment (Razorpay), Maps&lt;/li&gt;
&lt;li&gt;Custom APIs → Your backend (Python/Node)&lt;/li&gt;
&lt;/ul&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%2Fxq0alt22jzhpa2kwgtp8.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%2Fxq0alt22jzhpa2kwgtp8.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
