<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abuhuzaifa on Medium]]></title>
        <description><![CDATA[Stories by Abuhuzaifa on Medium]]></description>
        <link>https://medium.com/@abuhuzaifaw5?source=rss-f2cdf3af39d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*0h6f48Ybt_Q86fM1</url>
            <title>Stories by Abuhuzaifa on Medium</title>
            <link>https://medium.com/@abuhuzaifaw5?source=rss-f2cdf3af39d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:00:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abuhuzaifaw5/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[JAVA ROADMAD]]></title>
            <link>https://medium.com/@abuhuzaifaw5/java-roadmap-c33b072bf412?source=rss-f2cdf3af39d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c33b072bf412</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java-roadmap]]></category>
            <dc:creator><![CDATA[Abuhuzaifa]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 17:38:33 GMT</pubDate>
            <atom:updated>2025-07-01T17:43:56.265Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*EEd4fE27nOweBu2xb9aT6Q.png" /></figure><pre>Abu Huzaifa<br><br>https://github.com/iuzaifa<br>www.linkedin.com/in/abu-huzaifa-7b40b9286<br><br>### Java Notes Index<br><br>**IntDDroduction**<br><br>**1. Java Fundamentals**<br><br>1.1 Java Virtual Machine (JVM)<br>1.2 Java Runtime Environment (JRE)<br>1.3 Java Development Kit (JDK)<br>1.4 Platform Independence in Java<br>1.5 Just-In-Time (JIT) Compiler<br><br>**2. Java Program Structure**<br><br>2.1 Main Method Syntax (public static void main(String[] args))<br>2.2 Role of Keywords: public, static, void, main, String args[]<br>2.3 What if main is not static?<br><br>**3. Java Memory and String Handling**<br><br>3.1 Java String Pool<br>3.2 System.out vs System.err<br><br>**4. Input in Java**<br><br>4.1 Ways to Take Input<br><br>- Command Line<br>- BufferedReader<br>- Console Class<br>- Scanner Class<br>**5. Java Syntax and Operators**<br><br>5.1 print, println, and printf<br>5.2 &gt;&gt; vs &gt;&gt;&gt;<br>5.3 Dot Operator.<br><br>**6. Data Types in Java**<br><br>6.1 Primitive Data Types<br>6.2 Non-Primitive Data Types<br>6.3 Wrapper Classes<br><br>- Need and Features<br>- Autoboxing and Unboxing<br>**7. Variables in Java**<br><br>7.1 Instance vs Local Variables<br>7.2 Instance vs Class Variables<br>7.3 static Keyword<br>7.4 this Keyword<br><br><br>**8. String Handling Classes**<br><br>8.1 String vs StringBuffer<br>8.2 StringBuffer vs StringBuilder<br><br>**9. Object-Oriented Programming Concepts**<br><br>9.1 OOP Overview<br>9.2 Encapsulation<br>9.3 Inheritance<br>9.4 Polymorphism<br>9.5 Abstraction<br><br>**10. Classes and Objects**<br><br>10.1 What is a Class?<br>10.2 What is an Object?<br>10.3 Real-Life Example<br><br>**11. Constructors in Java**<br><br>11.1 What is a Constructor?<br>11.2 Types of Constructors<br><br>- Default<br>- Parameterized<br>- Constructor Overloading<br>11.3 Copy Constructor<br>11.4 Constructor vs Method<br>11.5 What if No Constructor is Provided?<br>**12. Packages in Java**<br><br>12.1 Definition and Purpose<br><br>**13. Pointers in Java**<br><br>13.1 Why Java Does Not Support Pointers<br><br>**14. Interfaces in Java**<br>14.1 What is an Interface?<br>14.2 Interface Features<br>14.3 Interface Example (Remote Control analogy)<br>14.4 Default Methods in Interface<br>14.5 Interface vs Abstract Class<br>**15. Abstraction**<br>15.1 What is Abstraction?<br>15.2 Abstract Class in Java<br>15.3 Abstract Methods and Concrete Methods<br>15.4 Abstract Class Real-Life Example (Vehicle)<br><br><br>**16. Encapsulation**<br>16.1 What is Encapsulation?<br>16.2 Data Hiding and Controlled Access<br>16.3 Real-Life Example (Capsule analogy)<br>**17. Aggregation**<br>17.1 What is Aggregation?<br>17.2 Has-a Relationship<br>17.3 Unidirectional Association<br>**18. Inheritance**<br>18.1 What is Inheritance?<br>18.2 Types of Inheritance<br>- Single<br>- Multilevel<br>- Hierarchical<br>- Multiple (via Interfaces only)<br>18.3 Why Multiple Inheritance is Not Supported<br>18.4 Diamond Problem<br>**19. Polymorphism**<br>19.1 What is Polymorphism?<br>19.2 Compile-Time Polymorphism (Method Overloading)<br>19.3 Runtime Polymorphism (Method Overriding)<br>19.4 Real-Life Example (Printer)<br>19.5 Static Methods and Overriding<br>**20. Collection Framework in Java**<br>20.1 What is the Collection Framework?<br>20.2 Interfaces in Collections (Set, List, Queue, Deque)<br>20.3 Classes in Collections (ArrayList, Vector, LinkedList, TreeSet, etc.)<br>**21. Vector in Java**<br>21.1 Features of Vector<br>21.2 Vector vs ArrayList<br>21.3 Synchronization in Vector<br>**22. Exception Handling in Java**<br>22.1 What is Exception Handling?<br>22.2 try, catch, finally, throw<br>22.3 Types of Exceptions<br>- Built-in<br>- User-defined<br>22.4 Runtime Exceptions<br>22.5 Checked vs Unchecked Exceptions<br>22.6 Difference between Error and Exception<br>22.7 NullPointerException<br><br><br>**23. final Keyword in Java**<br>23.1 Final Variable<br>23.2 Final Method<br>23.3 Final Class<br>23.4 Purpose and Usage<br>**24. finally Block in Java**<br>24.1 What is the finally Block?<br>24.2 Usage in try-catch-finally<br>24.3 Importance of Resource Cleanup<br>24.4 Example of finally Block Execution<br>**25. finalize() Method in Java**<br>25.1 What is finalize()?<br>25.2 Role in Garbage Collection<br>25.3 Usage and Limitations<br>25.4 Example of finalize()<br>**26. super Keyword in Java**<br>26.1 What is the super Keyword?<br>26.2 Accessing Parent Constructor<br>26.3 Accessing Parent Methods<br>26.4 Accessing Parent Variables<br>26.5 Real-life Use of super<br>**27. Multitasking in Java**<br>27.1 What is Multitasking?<br>27.2 Role of Threads<br>27.3 Benefits of Multitasking<br>**28. Multithreading in Java**<br>28.1 What is a Thread?<br>28.2 Multithreaded Program<br>28.3 Advantages of Multithreading<br>28.4 Threads vs Processes<br>**29. Thread Creation in Java**<br>29.1 Extending Thread Class<br>29.2 Implementing Runnable Interface<br>29.3 Runnable Interface Benefits<br>29.4 run() vs start()<br>**30. Thread Life Cycle**<br>30.1 New<br>30.2 Runnable<br>30.3 Blocked<br><br><br>30.4 Waiting<br>30.5 Terminated<br><br>**31. Thread Methods**<br>31.1 suspend() Method<br>31.2 resume(), stop(), and Alternatives<br>31.3 Main Thread in Java<br>**32. Garbage Collection in Java**<br>32.1 Need for Garbage Collection<br>32.2 How JVM Manages Memory<br>32.3 Role of finalize() in GC<br>32.4 Avoiding Memory Leaks<br>**33. JDBC (Java Database Connectivity)**<br>33.1 What is JDBC?<br>33.2 JDBC Components<br>- API<br>- DriverManager<br>- Connection<br>- Statement<br>- ResultSet<br>- RowSet<br>33.3 JDBC Drivers and Types<br>33.4 JDBC Architecture<br>33.5 Steps to Connect Database<br>33.6 Code Example for JDBC Connection<br>**34. JDBC Interfaces and Classes**<br>34.1 Connection Interface<br>34.2 Statement Interface<br>34.3 ResultSet Interface<br>34.4 RowSet Types<br>- JdbcRowSet<br>- CachedRowSet<br>- WebRowSet<br>- FilteredRowSet<br>- JoinRowSet<br>**35. Difference Between == and equals()**<br>35.1 == Operator (Reference Comparison)<br>35.2 equals() Method (Content Comparison)<br>35.3 Example with String<br>35.4 Use Case Scenarios<br>**36. Project: Bank Management System Overview**<br>36.1 Problem Solved<br><br><br>36.2 Reason for Selection<br>36.3 Project Structure<br>36.4 Tools and Libraries Used<br>36.5 Workflow of System<br>36.6 Security and Database Interaction<br><br># Introduction<br><br>**Good morning Sir or Maam, my name is Tejas Waghmare from rajgurunagar pune. I am<br>currently pursuing my Bachelor of Engineering in Computer Engineering from NBN Sinhgad<br>School Of Engineering, with an aggregate CGPA of 8.11.**<br><br>In terms of technical skills, I specialize in Java Full Stack Development, including java adv<br>java, JSP, Java Servlet, Spring Boot and Angular, and have hands-on experience with tools like<br>SQL, HTML, and CSS. I&#39;ve applied these skills to various projects, such as a dynamic Bank<br>Management system using JSP and Servlete and a Todo Task application integrating Spring<br>Boot and Angular.<br><br>I recently completed an internship at KasNet Technology, where I managed and deployed<br>Azure cloud solutions, **improving deployment** efficiency. Additionally, I hold an Azure AZ- 900<br>certification.<br><br>I am passionate about problem-solving, enjoy working on innovative projects, and am eager<br>to contribute my skills to a challenging and dynamic work environment. I look forward to<br>discussing how my skills and experiences align with the needs of organization.<br><br><br>## 1. JVM<br><br>The **Java Virtual Machine (JVM)** is the engine that drives Java applications. When a Java<br>program is compiled, it generates bytecode, a platform-independent intermediate code. The<br>JVM is responsible for converting this bytecode into machine code specific to the operating<br>system and hardware, enabling Java&#39;s &quot;Write Once, Run Anywhere&quot; functionality.<br><br>The JVM performs three main tasks: loading, verifying, and executing code.<br><br>The **Class Loader** loads the compiled bytecode into memory,<br><br>the **Bytecode Verifier** ensures Java’s security and syntax rules, and the<br><br>**Execution Engine** compiles it into machine instructions.<br><br>Additionally, the JVM handles **memory management** , allocating space for objects and<br>performing garbage collection to reclaim unused memory.<br><br>The **JRE (Java Runtime Environment)** is a software package that provides everything needed<br>to run Java applications.<br><br>It contains core Java libraries, classes, and resources necessary for program execution,<br>making it a crucial component for end-users who only need to run Java applications.<br><br>It includes the **JVM (Java Virtual Machine)** , which executes Java programs, along with the<br>libraries and other components required for the program to function properly.<br><br>When you install the JRE on your system, it allows you to run Java programs but does not<br>include tools for writing or compiling Java code.<br><br>**Is Java Platform Independent if then how?**<br><br>Yes, Java is a Platform Independent language. Unlike many programming languages javac<br>compiles the program to form a bytecode or .class file. This file is independent of the<br>software or hardware running but needs a JVM(Java Virtual Machine) file preinstalled in the<br>operating system for further execution of the bytecode.<br><br><br>#### JIT<br><br>JIT stands for (Just-in-Time) compiler is a part of JRE(Java Runtime Environment), it is used<br>for better performance of the Java applications during run-time.<br><br>#### JDK :<br><br>JDK stands for Java Development Kit which provides the environment to develop and<br>execute Java programs. JDK is a package that includes two things Development Tools to<br>provide an environment to develop your Java programs and, JRE to execute Java programs or<br>applications.<br><br><br>1. **public** : the public is the access modifier responsible for mentioning who can access<br>    the element or the method and what is the limit. It is responsible for making the<br>    main function globally available. It is made public so that JVM can invoke it from<br>    outside the class as it is not present in the current class.<br>2. **static** : static is a keyword used so that **we can use the element without initiating** the<br>    class so to avoid the unnecessary allocation of the memory.<br>3. **void** : void is a keyword and is used to specify that a method doesn’t return anything.<br>    As the main function doesn’t return anything we use void.<br>4. **main** : main represents that the function declared is the main function. It helps JVM<br>    to identify that the declared function is the main function.<br>5. **String args[]** : It stores Java command-line arguments and is an array of type<br>    java.lang.String class.<br><br>**Java String Pool**<br><br>A Java String Pool is a place in heap memory where all the strings defined in the program are<br>stored.<br><br>**What will happen if we declare don’t declare the main as static?**<br><br>We can declare the main method without using static and without getting any errors. But,<br>the main method will not be treated as the entry point to the application or the program.<br><br>**What are Packages in Java?**<br><br>Packages in Java can be defined as the grouping of related types of classes, interfaces, etc<br>providing access to protection and namespace management.<br><br><br>**Explain different data types in Java.**<br><br>There are 2 types of data types in Java as mentioned below:<br><br>1. Primitive Data Type<br>2. Non-Primitive Data Type or Object Data type<br><br>**Primitive Data Type:** Primitive data are single values with no special capabilities. There are 8<br>primitive data types:<br><br>- **boolean** : stores value true or false<br>- **byte** : stores an 8-bit signed two’s complement integer<br>- **char** : stores a single 16-bit Unicode character<br>- **short** : stores a 16-bit signed two’s complement integer<br>- **int** : stores a 32-bit signed two’s complement integer<br>- **long** : stores a 64-bit two’s complement integer<br>- **float** : stores a single-precision 32-bit IEEE 754 floating-point<br>- **double** : stores a double-precision 64-bit IEEE 754 floating-point<br><br>**Non-Primitive Data Type:** Reference Data types will contain a memory address of the<br>variable’s values because it is not able to directly store the values in the memory. Types of<br>Non-Primitive are mentioned below:<br><br>- Strings<br>- Array<br>- Class<br>- Object<br>- Interface<br><br>**Can we declare Pointer in Java?**<br><br>No, Java doesn’t provide the support of Pointer. As Java needed to be more secure because<br>which feature of the pointer is not provided in Java.<br><br><br>**What is the Wrapper class in Java?**<br><br>Wrapper, in general, is referred to a larger entity that encapsulates a smaller entity. Here in<br>Java, the wrapper class is an object class that encapsulates the primitive data types.<br><br>The primitive data types are the ones from which further data types could be created. For<br>example **, integers can further lead to the construction of long, byte, short, etc**. On the<br>other hand, the string cannot, hence it is not primitive.<br><br>**Why do we need wrapper classes?**<br><br>The wrapper class is an object class that encapsulates the primitive data types, and we need<br>them for the following reasons:<br><br>1. Wrapper classes are final and immutable<br>2. Provides methods like valueOf(), parseInt(), etc.<br>3. It provides the feature of autoboxing and unboxing.<br><br>**Differentiate between instance and local variables.**<br><br>```<br>Instance Variable Local Variable<br>```<br>```<br>Declared outside the method, directly<br>invoked by the method.<br>```<br>```<br>Declared within the<br>method.<br>```<br>```<br>Has a default value. No default value<br>```<br>```<br>It can be used throughout the class. The scope is limited to the method.<br>```<br>**Explain the difference between instance variable and a class variable.**<br><br>**Instance Variable:** A class variable **without a static modifier** known as an instance variable is<br>typically **shared by** all instances of the class. These variables can have distinct values among<br>several objects. The contents of an instance variable are completely independent of one<br>object instance from another because they are related to a specific object instance of the<br>class.<br><br><br>**Class Variable:** Class Variable variable can be declared anywhere at the class level using the<br>keyword static. These variables can only have one value when applied to various objects.<br>These variables can be shared by all class members since they are not connected to any<br>specific object of the class.<br><br>**static keyword**<br><br>In Java, the **static keyword** is used to indicate that a variable, method, or block belongs to<br>the **class** rather than any specific object of the class.<br><br>This means it can be accessed **without creating an instance of the class.**<br><br>**Key Points:**<br><br>1. **Static Variables:**<br>    o Shared across all objects of the class.<br>    o Example: A static variable count keeps the same value for all objects.<br>2. **Static Methods:**<br>    o Can be called using the class name, without creating an object.<br>    o Example: Math.pow() is a static method in Java.<br>    o Cannot access non-static (instance) variables directly.<br>3. **Static Blocks:**<br>    o Used for initializing static variables when the class is loaded.<br>    o Runs only once, when the class is first used.<br><br>**this keyword**<br><br>In Java, the **this keyword** refers to the current object of the class.<br><br>It is used to work with the **instance variables, methods, or constructors** of that specific<br>object.<br><br>**Key Uses of this Keyword:**<br><br>1. **Access Instance Variables:**<br>    When instance variables and method parameters have the same name, this helps<br>    distinguish the instance variable from the local parameter.<br><br><br>2. **Call Another Constructor (Constructor Chaining):**<br>    this() is used to call one constructor from another within the same class, making<br>    code more organized.<br>3. **Pass the Current Object:**<br>    this can be passed as an argument to methods or constructors, allowing another<br>    method or class to work with the current object.<br><br>In simple terms, the this keyword allows an object to refer to itself, which is helpful in<br>**solving naming conflicts, reusing constructors, and implementing advanced object-<br>oriented** techniques.<br><br>```<br>System.out System.err<br>```<br>```<br>It will print to the standard out of the<br>system.<br>It will print to the standard error.<br>```<br>```<br>It is mostly used to display results on the<br>console.<br>It is mostly used to output error texts.<br>```<br>**How many ways you can take input from the console?**<br><br>There are two methods to take input from the console in Java mentioned below:<br><br>1. Using Command line argument<br>2. Using Buffered Reader Class<br>3. Using Console Class<br>4. Using Scanner Class<br><br>**Difference in the use of print, println, and printf.**<br><br>print, println, and printf all are used for printing the elements but print prints all the<br>elements and the cursor remains in the same line. println shifts the cursor to next line. And<br>with printf we can use format identifiers too.<br><br><br>**Explain the difference between &gt;&gt; and &gt;&gt;&gt; operators.**<br><br>Operators like &gt;&gt; and &gt;&gt;&gt; seem to be the same but act a bit differently. &gt;&gt; operator shifts<br>the sign bits and the &gt;&gt;&gt; operator is used in shifting out the zero-filled bits.<br><br>**What is dot operator?**<br><br>The Dot operator in Java is used to access the instance variables and methods of class<br>objects.<br><br>**What are the differences between String and StringBuffer?**<br><br>```<br>String StringBuffer<br>```<br>```<br>Store of a sequence of characters. Provides functionality to work with the<br>strings.<br>```<br>```<br>It is immutable.<br>```<br>```<br>It is mutable (can be modified and<br>other string operations could be<br>performed on them.)<br>```<br>```<br>No thread operations in a<br>string.<br>```<br>```<br>It is thread-safe (two threads can’t call<br>the methods of StringBuffer<br>simultaneously)<br>```<br><br>**48. What are the differences between StringBuffer and StringBuilder?**<br><br>```<br>StringBuffer StringBuilder<br>```<br>```<br>StringBuffer provides functionality to work<br>with the strings.<br>```<br>```<br>StringBuilder is a class used to build a<br>mutable string.<br>```<br>```<br>It is thread-safe (two threads can’t call the<br>methods of StringBuffer simultaneously)<br>```<br>```<br>It is not thread-safe (two threads can call<br>the methods concurrently)<br>```<br>```<br>Comparatively slow as it is synchronized.<br>Being non-synchronized, implementation is<br>faster<br>```<br>**OOP (Object-Oriented Programming):**<br><br>**OOP (Object-Oriented Programming)** is a programming paradigm based on the concept of<br>**objects** , which represent real-world entities. These objects have two main components:<br>**attributes** (data) and **behavior** (methods or functions).<br><br>**Key Principles of OOP:**<br><br>1. **Encapsulation:**<br>    o Bundling data (variables) and methods (functions) into a single unit (class)<br>       and restricting direct access to some components for better security and<br>       control.<br>    o Example: Using private variables with public getter and setter methods.<br>2. **Inheritance:**<br>    o A mechanism where one class (child) inherits attributes and behaviors from<br>       another class (parent), enabling code reuse and hierarchical relationships.<br>3. **Polymorphism:**<br>    o The ability for a single method or object **to take multiple forms** , allowing<br>       flexibility in method behavior.<br>    o Example: Method Overloading (same name, different parameters) and<br>       Method Overriding (same name and parameters, but different<br>       implementation).<br><br><br>4. **Abstraction:**<br>    o Hiding implementation details and exposing only essential features through<br>       abstract classes or interfaces.<br>    o Focuses on **what** an object does rather than **how** it does it.<br><br>**What are Classes in Java?**<br><br>In Java, Classes are the collection of objects sharing similar characteristics and attributes.<br><br>Classes represent the blueprint or template from which objects are created.<br><br>Classes are not real-world entities but help us to create objects which are real-world<br>entities.<br><br>**What is an object?**<br><br>The object is a real-life entity that has certain properties and methods associated with it.<br><br>The object is also defined as the instance of a class.<br><br>An object can be declared using a new keyword.<br><br>**Real-Time Example:**<br><br>- **Class:** Think of a &quot;Car&quot; as a class.<br>    It defines properties like color, brand, and model<br>    behaviors like start, stop, and accelerate.<br>- **Object:** A specific car, like a &quot;Red Toyota Corolla,&quot; is an object.<br>    It has the actual color, brand, and model values defined in the class.<br><br><br>**Constructor:**<br><br>A **constructor** in Java is a special method used to initialize objects of a class.<br><br>It is called automatically when an object is created.<br><br>The constructor sets up the initial state of the object by assigning values to its instance<br>variables or performing other setup tasks.<br><br>**Key Features of a Constructor:**<br><br>1. **Same Name as Class:**<br>    o The constructor&#39;s name must match the class name.<br>2. **No Return Type:**<br>    o Constructors do not have a return type, not even void.<br>3. **Automatic Invocation:**<br>    o It is called automatically when an object is created.<br><br>**Types of Constructors:**<br><br>1. **Default Constructor:**<br>    o A no-argument constructor provided by Java if no constructor is explicitly<br>       defined.<br>    o Initializes objects with default values.<br>2. **Parameterized Constructor:**<br>    o A constructor that takes arguments to initialize an object with specific values.<br>3. **Constructor Overloading:**<br>    o A class can have multiple constructors with different parameters, allowing<br>       flexibility in object creation.<br><br>In simple terms, a constructor is like a setup process for an object, making sure it’s ready to<br>use right after being created.<br><br>**What happens if you don’t provide a constructor in a class?**<br><br>If you don’t provide a constructor in a class in Java, the compiler automatically generates a<br>default constructor with no arguments and no operation which is a default constructor.<br><br><br>**What do you understand by copy constructor in Java?**<br><br>A **copy constructor** in Java is a special type of constructor used to create a new object by<br>copying the values from an existing object.<br><br>It essentially duplicates an object by initializing the new object&#39;s fields with the same values<br>as another object of the same class.<br><br>**What are the differences between the constructors and methods?**<br><br>Java constructors are used for initializing objects. During creation, constructors are called to<br>set attributes for objects apart from this few basic differences between them are:<br><br>1. Constructors are only called when the object is created but other methods can be<br>    called multiple times during the life of an object.<br>2. Constructors do not have a return type, whereas methods have a return type, which<br>    can be void or any other type.<br>3. Constructors are used to setting up the initial state but methods are used to perform<br>    specific actions.<br><br>**What is an Interface?**<br><br>In Java, an **interface** is like a **contract** that defines a set of rules (methods) that a class must<br>follow.<br><br>It specifies **what** a class should do, but not **how** it should do it.<br><br>**Key Points:**<br><br>- An interface only contains method declarations (no method body).<br>- A class that implements the interface must provide the implementation for all the<br>    methods.<br>- It helps in achieving abstraction and multiple inheritance.<br><br>**Example in Simple Terms:**<br><br>Think of an interface as a **remote control**. The remote has buttons like powerOn, volumeUp,<br>and channelChange. The remote doesn’t care whether it’s controlling a TV, an AC, or a music<br>system—each device just needs to implement these functions in its own way.<br><br><br>Features of the Interface are mentioned below:<br><br>- The interface can help to achieve total abstraction.<br>- Allows us to use multiple inheritances in Java.<br>- Any class can implement multiple interfaces even when one class can extend only<br>    one class.<br>- It is also used to achieve loose coupling.<br><br>**interface** InterfaceName {<br><br>// Abstract method (no body)<br><br>void method1();<br><br>// Default method (with body, since Java 8)<br><br>default void method2() {<br><br>System.out.println(&quot;This is a default method.&quot;);<br><br>}<br><br>}<br><br>**Abstraction**<br><br>In Java, **abstraction** is the process of hiding unnecessary details and showing only the<br>essential features of an object or system.<br><br>It focuses on **what** an object does, not **how** it does it.<br><br>**Key Points:**<br><br>- Abstraction is achieved using **abstract classes** and **interfaces**.<br>- It helps simplify complex systems by breaking them into smaller, manageable parts.<br><br>**Example in Simple Terms:**<br><br>Think of a **coffee machine**.<br><br>- You press a button to make coffee (what it does).<br>- You don’t need to know how the machine grinds beans or boils water (how it does<br>    it).<br><br>In short, abstraction helps you interact with a system without worrying about its internal<br>complexities.<br><br><br>**abstract** class ClassName {<br><br>// Abstract method (no body)<br><br>**abstract** void abstractMethod();<br><br>// Concrete method (with body)<br><br>void concreteMethod() {<br><br>System.out.println(&quot;This is a concrete method.&quot;);<br><br>}}<br><br>```<br>Abstract Class Interface Class<br>```<br>```<br>Both abstract and non-abstract methods<br>may be found in an abstract class.<br>```<br>```<br>The interface contains only abstract<br>methods.<br>```<br>```<br>Abstract Class supports Final methods.<br>The interface class does not support Final<br>methods.<br>```<br>```<br>Multiple inheritance is not supported by<br>the Abstract class.<br>```<br>```<br>Multiple inheritances is supported by<br>Interface Class.<br>```<br>```<br>Abstract Keyword is used to declare<br>Abstract class.<br>```<br>```<br>Interface Keyword is used to declare the<br>interface class.<br>```<br>```<br>extend keyword is used to extend an<br>Abstract Class.<br>```<br>```<br>implements keyword is used to implement<br>the interface.<br>```<br>```<br>Abstract Class has members like<br>protected, private, etc. All class members are public by default.^<br>```<br><br>**Encapsulation**<br><br>In Java, **encapsulation** is the process **of bundling data** (variables) and **methods** (functions)<br>that operate on that data into a single unit, typically a class.<br><br>It also involves **restricting direct access** to some of the object&#39;s components to ensure better<br>control and security.<br><br>**Key Features:**<br><br>1. **Data Hiding:**<br>    o By using **private access modifiers** for variables, you hide them from external<br>       access.<br>2. **Controlled Access:**<br>    o You provide access to the hidden data through **public getter and setter**<br>       **methods**.<br><br>**Example in Simple Terms:**<br><br>Think of a **capsule (medicine)** —it encapsulates the ingredients inside a sealed container.<br>Similarly, in Java, a class hides its internal details and only exposes what is necessary through<br>methods.<br><br>In short, **encapsulation** protects data from unauthorized access and makes the code more<br>modular, secure, and easy to maintain.<br><br>**What do you mean by aggregation?**<br><br>- Aggregation is a term related to **the relationship between two classes** best described<br>    as a “ **has-a** ” relationship.<br>- This kind is the most specialized version of association.<br>- It is a unidirectional association means it is a **one-way relationship**.<br>- It contains the reference to another class and is said to have ownership of that class.<br><br><br>**Define Inheritance**<br><br>In Java, **inheritance** is a mechanism where one class (called the **child class** or **subclass** ) can<br>get the properties (fields) and behaviors (methods) of another class (called the **parent class**<br>or **superclass** ). It allows code to be reused and establishes a relationship between classes.<br><br>**Key Points:**<br><br>1. **Reusability:**<br>    o The **child class** can use the existing code of the **parent class** instead of writing<br>       it again.<br>2. **Extensibility:**<br>    o The child class can add its own features or modify the inherited ones.<br>3. **Syntax:**<br>    o Use the extends keyword for inheritance.<br><br>**Example in Simple Terms:**<br><br>Think of a **family relationship** :<br><br>- A child inherits quality like eye color or height from their parents.<br>- Similarly, in Java, a child class can inherit methods and variables from the parent<br>    class.<br><br>In short, **inheritance** helps reduce redundancy, makes the code more organized, and<br>establishes a hierarchical relationship between classes.<br><br>**What are the different types of inheritance in Java?**<br><br>In Java, Inheritance is of four types:<br><br><br>- **Single Inheritance:**<br>    When a **child or subclass** extends **only one superclass** , it is known to be single<br>    inheritance.<br>    Single-parent class properties are passed down to the child class.<br>- **Multilevel Inheritance**<br>    means a class is **derived** from another class, which **itself** is derived from a **third**<br>    class.<br>    This creates a chain of inheritance where properties and methods are passed down<br>    multiple levels.<br>- **Hierarchical Inheritance:**<br>    means **multiple child classes** inherit from a **single parent** class.<br>    The **parent** class serves as a **common base** , and each child class can extend and<br>    customize its behavior while sharing the features of the parent class.<br>- **Multiple Inheritance:**<br>    When a **one child class** inherits from **multiple parent** classes is known as Multiple<br>    Inheritance.<br>    In Java, it only supports multiple inheritance of interfaces, not classes.<br><br>**Why we are not using multiple inheritance in Java?**<br><br>We don’t use **multiple inheritance** in Java because it can lead to **ambiguity and complexity** ,<br>especially when two parent classes have methods with the same name. This is called the<br>**Diamond Problem**.<br><br>**Key Reasons:**<br><br>1. **Ambiguity (Diamond Problem):**<br>    o If two parent classes have the same method, the child class wouldn’t know<br>       which one to use, causing confusion.<br>2. **Complexity:**<br>    o Handling multiple parent classes makes the code harder to understand and<br>       maintain.<br><br><br>3. **Better Alternatives:**<br>    o Instead of multiple inheritance, Java uses **interfaces** to achieve the same<br>       functionality without ambiguity.<br><br>**Simple Example:**<br><br>Imagine **Parent1** and **Parent2** both have a method display(). If the child class inherits from<br>both, Java wouldn’t know which display() to execute.<br><br>In short, Java avoids multiple inheritance to prevent errors and keep code simpler and more<br>reliable.<br><br><br>**What is Polymorphism?**<br><br>**Polymorphism** in Java means &quot;one name, many forms.&quot;<br><br>It allows the same action (method or object) to behave differently based on the context.<br><br>**Key Points:**<br><br>1. **Method Overloading (Compile-time Polymorphism):**<br>    o **Same method** name, but **different parameter** lists in the same class.<br>    o Example: One method add() can add two numbers or concatenate two<br>       strings, depending on the input.<br>2. **Method Overriding (Runtime Polymorphism):**<br>    o A child class provides a **specific implementation** for a method that is already<br>       defined in its parent class.<br>    o Child class bap banto... swatach dok lavto.<br>    o Example: A Dog class overrides the speak() method of the Animal class to<br>       bark instead of making a generic animal sound.<br><br>**Simple Real-Life Example:**<br><br>Think of a **printer** :<br><br>- **Polymorphism in action:** The same print() function prints a photo, a document, or a<br>    sticker, depending on the input.<br><br>In short, **polymorphism** makes code flexible and allows a single interface to work in multiple<br>ways.<br><br>**Can we override the static method?**<br><br>No, as static methods are part of the class rather than the object so we can’t override them.<br><br><br>**What is Abstract class?**<br><br>An **abstract class** in Java is a class that cannot be instantiated (you can&#39;t create an object<br>from it directly).<br><br>It is used to represent a general concept, providing a base for other classes to build on. An<br>abstract class can have both **abstract methods** (methods without a body) and **concrete<br>methods** (methods with a body).<br><br>**Key Points:**<br><br>1. **Abstract Methods:**<br>    o These methods are declared in the abstract class but don&#39;t have a body. The<br>       child class must provide the implementation.<br>2. **Concrete Methods:**<br>    o These are normal methods with code inside them, and the child class can use<br>       them without overriding.<br>3. **Cannot Instantiate:**<br>    o You can&#39;t create an object of an abstract class directly. Instead, you create<br>       objects of its subclasses.<br><br>**Simple Example:**<br><br>Think of an **abstract blueprint** for a **vehicle** :<br><br>- An abstract class Vehicle might have an abstract method start(), but different vehicles<br>    like Car and Bike will implement how the start() method works for them.<br><br>In short, an **abstract class** is used to define common characteristics while leaving the specific<br>implementation details to the subclasses.<br><br>**What is Collection Framework in Java?**<br><br>Collections are units of objects in Java.<br><br>The collection framework is a set of interfaces and classes in Java that are used to represent<br>and manipulate collections of objects in a variety of ways.<br><br><br>The collection framework contains classes(ArrayList, Vector, LinkedList, PriorityQueue,<br>TreeSet) and multiple interfaces (Set, List, Queue, Deque) where every interface is used to<br>store a specific type of data.<br><br>**Why Use the Collection Framework?**<br><br>Before Java 1.2, developers relied on arrays and custom data structures. These had<br>limitations like fixed size, no dynamic resizing, and lack of built-in methods for sorting,<br>searching, or manipulation. The Collection Framework solves these by:<br><br>- Providing **ready-made, reusable classes and interfaces**<br>- Ensuring **type safety** using Generics<br>- Supporting **polymorphism** (one interface, multiple implementations)<br>- Offering **algorithms** (like sorting, shuffling)<br>- Allowing **interoperability** between different types of collections<br><br>**Key Components of the Collection Framework**<br><br>**1. Interfaces**<br><br>These define the basic types of collections and the operations they support.<br><br>```<br>Interface Description<br>```<br>```<br>Collection Root of the collection hierarchy<br>```<br>```<br>List<br>Ordered collection that can contain duplicate elements (ArrayList, LinkedList,<br>Vector)<br>```<br>```<br>Set Unordered collection that cannot contain duplicate elements (HashSet, TreeSet)<br>```<br>```<br>Queue Stores elements in FIFO (First In, First Out) order (PriorityQueue, ArrayDeque)<br>```<br>```<br>Deque Double-ended queue, allows insertion/removal at both ends<br>```<br>```<br>Map Not part of Collection but related; stores key-value pairs (HashMap, TreeMap,<br>LinkedHashMap)<br>```<br><br>**2. Classes**<br><br>These are concrete implementations of the interfaces.<br><br>```<br>Class Description<br>```<br>```<br>ArrayList Dynamic array; fast for random access<br>```<br>```<br>LinkedList Doubly linked list; fast for insertions/deletions<br>```<br>```<br>Vector Synchronized version of ArrayList<br>```<br>```<br>HashSet Stores unique elements, no guaranteed order<br>```<br>```<br>TreeSet Sorted set<br>```<br>```<br>HashMap Key-value storage; allows one null key<br>```<br>```<br>TreeMap Sorted map based on keys<br>```<br>**Features of Collection Framework**<br><br>- **Generics** : Type-safe collections (e.g., List&lt;String&gt;)<br>- **Algorithms** : Built-in methods for sorting, reversing, searching<br>- **Thread-safe versions** : Collections.synchronizedList(), ConcurrentHashMap<br>- **Utility classes** : Collections, Arrays<br><br>**Important Points for Interviews**<br><br>1. **Difference between ArrayList and LinkedList**<br>    o ArrayList uses dynamic array (fast access, slow inserts/deletes)<br>    o LinkedList uses nodes (slow access, fast inserts/deletes)<br>2. **Set vs List**<br>    o List allows duplicates, maintains order<br>    o Set does not allow duplicates, unordered or sorted (TreeSet)<br>3. **HashMap vs TreeMap**<br>    o HashMap is faster, unsorted<br>    o TreeMap is sorted by key, slower than HashMap<br>4. **Thread Safety**<br><br><br>```<br>o Vector and Hashtable are synchronized (thread-safe)<br>o ArrayList and HashMap are not thread-safe by default<br>```<br>**Example Code: Using ArrayList**<br><br>import java.util.*;<br><br>public class Demo {<br><br>public static void main(String[] args) {<br><br>List&lt;String&gt; names = new ArrayList&lt;&gt;();<br><br>names.add(&quot;Tejas&quot;);<br><br>names.add(&quot;Sujal&quot;);<br><br>names.add(&quot;Tejas&quot;); // allowed in List<br><br>for (String name : names) {<br><br>System.out.println(name);<br><br>}<br><br>}<br><br>}<br><br>**What is a Vector in Java?**<br><br>Vectors in Java are similar and can store multiple elements inside them. Vectors follow<br>certain rules mentioned below:<br><br>**1.** Vector can be imported using **Java.util.Vector.**<br>2. Vector is implemented using a **dynamic array** as the size of the vector increases and<br>    decreases depending upon the elements inserted in it.<br>3. Elements of the Vector **using index numbers**.<br>4. Vectors are **synchronized in nature** means they only used a **single thread** ( only one<br>    process is performed at a particular time ).<br><br><br>5. ****** The vector contains many methods that are not part of the collections framework.<br><br>**What is Exception Handling?**<br><br>**Exception Handling** in Java is a way to handle **unexpected events or errors** that occur during<br>the execution of a program.<br><br>It ensures the program **doesn’t crash** and can handle errors gracefully, allowing it to<br>continue running or **terminate safely**.<br><br>**Key Points:**<br><br>1. **What is an Exception?**<br>    o An exception is an unexpected event, like dividing by zero, accessing an<br>       invalid array index, or trying to open a non-existent file.<br>2. **How it Works:**<br>    o Java uses a mechanism to detect and handle exceptions using try, catch,<br>       finally, and throw blocks.<br>    o The error is &quot;caught&quot; and managed instead of letting the program crash.<br><br>**Simple Example:**<br><br>Imagine you’re withdrawing money from an ATM:<br><br>- If you try to withdraw more than your balance, the ATM doesn’t shut down; instead,<br>    it shows an error message like &quot;Insufficient Funds.&quot;<br><br>In short, **exception handling** makes your program robust and user-friendly by managing<br>errors in a controlled way.<br><br><br>**How many types of exceptions can occur in a Java program?**<br><br>**There are generally two types of exceptions in Java:**<br><br>- **Built-in Exceptions:** Built-in exceptions in Java are provided by the Java Libraries.<br>    These exceptions can be further divided into two subcategories<br>    i.e., checked and unchecked Exceptions.<br>    Below are some of the built-in exceptions in Java:<br>       1. ArrayIndexOutOfBoundsExceptions<br>       2. ClassNotFoundException<br>       3. FileNotFoundException<br>       4. IOException<br>       5. NullPointerException<br>       6. ArithmeticException<br>       7. InterruptedException<br>       8. RuntimeException<br>- **User-Defined Exceptions:** User-defined exceptions are defined by the programmers<br>    themselves **to handle some specific situations** or errors which are not covered by<br>    built-in exceptions.<br>    To define user-defined exceptions a **new class that extends** the appropriate<br>    exception class must be defined.<br>    User-defined Exceptions in Java are used when the built-in exceptions are in Java.<br><br><br>**Difference between an Error and an Exception.**<br><br>```<br>Errors Exceptions<br>```<br>```<br>Recovering from Errors is not<br>possible.<br>```<br>```<br>Recover from exceptions by either using a try-<br>catch block or throwing exceptions back to the<br>caller.<br>```<br>```<br>Errors are all unchecked types in Java.<br>It includes both checked as well as unchecked<br>types that occur.<br>```<br>```<br>Errors are mostly caused by the<br>environment in which the program is<br>running.<br>```<br>```<br>The program is mostly responsible for causing<br>exceptions.<br>```<br>```<br>Errors can occur at compile time as<br>well as run time. Compile Time:<br>Syntax Error, Run Time: Logical Error.<br>```<br>```<br>All exceptions occur at runtime but checked<br>exceptions are known to the compiler while<br>unchecked are not.<br>```<br>**Explain Runtime Exceptions.**<br><br>In Java, **Runtime Exceptions** are errors that occur during the program&#39;s **execution** (runtime).<br>They are **unchecked** exceptions, meaning the **compiler doesn&#39;t force you to handle** them or<br>declare them in the **throws clause**. Examples include:<br><br>- **NullPointerException:** When you try to use an object reference that is null.<br>- **ArrayIndexOutOfBoundsException** : When accessing an invalid index in an array.<br>- **ArithmeticException** : Like dividing a number by zero.<br><br>These exceptions often indicate bugs in the program that you need to fix.<br><br>**What is NullPointerException?**<br><br>It is a type of run-time exception that is thrown when the program attempts to use an object<br>reference that has a null value.<br><br><br>The main use of NullPointerException is to indicate that **no value is assigned to a reference<br>variable** , also it is used for implementing data structures like linked lists and trees.<br><br>**Checked Exception:**<br><br>Checked Exceptions are the exceptions that **are checked during compile** time of a program.<br>In a program, if some code within a method throws a checked exception, then the method<br>must either handle the exception or must specify the exception using the throws keyword.<br><br>**Unchecked Exception:**<br><br>Unchecked are the exceptions that are **not checked at compile time** of a program.<br>Exceptions under Error and RuntimeException classes are unchecked exceptions, everything<br>else under throwable is checked.<br><br>**What is the use of the final keyword?**<br><br>The final keyword is used to make functions non-virtual. By default, all the functions are<br>virtual so to make it non-virtual we use the final keyword.<br><br>**Final Variable** : Its value cannot be changed once assigned.<br>Example: final int x = 10;<br><br>**Final Method** : It cannot be overridden by child classes.<br><br>**Final Class** : It cannot be extended/inherited.<br>Example: final class A { }<br><br>helps ensure immutability or prevent modifications.<br><br>**What purpose do the keywords final, finally, and finalize fulfill?**<br><br>**i). final:**<br><br>final is a keyword is used with the variable, method, or class so that they can’t be<br>overridden.<br><br>**ii) finally**<br><br>The **finally block** in Java is used to execute code **after a try-catch block** , regardless of<br>whether an exception was thrown or not. It is typically used to **clean up resources** like<br>closing files, streams, or database connections.<br><br><br>**iii). finalize**<br><br>It is a **method** that is called **just before deleting/destructing the objects** which are eligible<br>for **Garbage collection** to perform clean-up activity.<br><br>**Super keyword:**<br><br>The **super** keyword in Java refers to the **parent class** and is used for the following purposes:<br><br>1. **Access Parent Class Constructor** :<br>    It calls the constructor of the parent class.<br>    Example:<br><br>class Parent {<br><br>Parent() { System.out.println(&quot;Parent Constructor&quot;); }<br><br>}<br><br>class Child extends Parent {<br><br>Child() {<br><br>super(); // Calls Parent&#39;s constructor<br><br>System.out.println(&quot;Child Constructor&quot;);<br><br>}<br><br>}<br><br>2. **Access Parent Class Methods** :<br>    It calls a method in the parent class that is overridden in the child class.<br>    Example:<br><br>class Parent {<br><br>void display() { System.out.println(&quot;Parent Method&quot;); }<br><br>}<br><br><br>class Child extends Parent {<br><br>void display() {<br><br>super.display(); // Calls Parent&#39;s display method<br><br>System.out.println(&quot;Child Method&quot;);<br><br>}<br><br>}<br><br>3. **Access Parent Class Variables** :<br>    It accesses a variable in the parent class hidden by a child class variable.<br>    Example:<br><br>class Parent {<br><br>int x = 10;<br><br>}<br><br>class Child extends Parent {<br><br>int x = 20;<br><br>void show() {<br><br>System.out.println(super.x); // Access Parent&#39;s x<br><br>}<br><br>}<br><br>The super keyword helps manage inheritance.<br><br>**What is multitasking?**<br><br>Multitasking in Java refers to a program’s capacity to carry out several tasks at once.<br><br>Threads, which are quick operations contained within a single program, can do this.<br>Executing numerous things at once is known as multitasking.<br><br>**What do you mean by a Multithreaded program?**<br><br>A **multithreaded program** in Java is a program that can run multiple tasks (threads)<br>**simultaneously** , allowing better use of CPU resources.<br><br><br>- A **thread** is a lightweight unit of execution.<br>- Multithreading lets a program perform **multiple operations at the same time** , like<br>    **downloading a file while processing user input**.<br><br>Example:<br><br>class MyThread extends Thread {<br><br>public void run() {<br><br>System.out.println(&quot;Thread is running&quot;);<br><br>}<br><br>}<br><br>public class Main {<br><br>public static void main(String[] args) {<br><br>MyThread t1 = new MyThread(); // Create a thread<br><br>t1.start(); // Start the thread<br><br>}<br><br>}<br><br>Multithreading improves performance, especially in tasks like games, web servers, or<br>processing large data.<br><br>**What are the advantages of multithreading?**<br><br>There are multiple advantages of using multithreading which are as follows:<br><br>1. Responsiveness: User Responsiveness increases because multithreading interactive<br>    application allows running code even when the section is blocked or executes a<br>    lengthy process.<br>2. Resource Sharing: The process can perform **message passing and shared memory**<br>    because of multithreading.<br>3. Economy: We are able to share memory because of which the processes are<br>    economical.<br>4. Scalability: Multithreading on multiple CPU machines increases parallelism.<br><br><br>5. Better Communication: Thread synchronization functions improves inter-process<br>    communication.<br>6. Utilization of multiprocessor architecture<br>7. Minimized system resource use<br><br>**What are the two ways in which Thread can be created?**<br><br>Multithreading is a Java feature that **allows concurrent execution** of two or more parts of a<br>program for **maximum utilization of the CPU**. In general, threads are small, lightweight<br>processes with separate paths of execution. These threads use shared memory, but they act<br>independently, thus if any one thread fails it does not affect the other threads. There are<br>two ways to create a thread:<br><br>- By extending the Thread class<br>- By implementing a Runnable interface.<br><br>**By extending the Thread class**<br><br>We create a class that extends the **java.lang.Thread class**. This class **overrides the run()**<br>method available in the Thread class. A thread begins its life inside run() method.<br><br>**Syntax:**<br><br>public class MyThread extends Thread {<br>public void run() {<br>// thread code goes here<br>}<br>}<br><br>**By implementing the Runnable interface**<br><br>We create a new class that implements **java.lang.Runnable** interface and override run()<br>method. Then we instantiate a Thread object and call the start() method on this object.<br><br>**Syntax:**<br><br>public class MyRunnable implements Runnable {<br>public void run() {<br>// thread code goes here<br>}<br>}<br><br><br>**What is a thread?**<br><br>Threads in Java are subprocess with lightweight with the **smallest unit of processes** and also<br>has separate paths of execution.<br><br>A thread has its own **program counter, execution stack, and local variables** , but it shares the<br>same memory space with other threads in the same process.<br><br>Java provides built-in support for multithreading through the **Runnable interface** and<br>the **Thread class**.<br><br>**Runnable interface**<br><br>The **Runnable interface** in Java is used to represent a task that can be executed by a thread.<br>It is part of the java.lang package and has a single method:<br><br>**Method:**<br><br>java<br><br>Copy code<br><br>void run();<br><br>- The **run() method** contains the **code that you want the thread to execute.**<br><br>**Why use Runnable?**<br><br>1. It allows our class to extend another class (since Java doesn&#39;t support multiple<br>    inheritance).<br>2. It separates the task logic from the thread&#39;s execution logic.<br><br>**Example:**<br><br>class MyTask implements Runnable {<br><br>public void run() {<br><br>System.out.println(&quot;Task is running&quot;);<br><br>}<br><br><br>#### }<br><br>public class Main {<br><br>public static void main(String[] args) {<br><br>MyTask task = new MyTask();<br><br>Thread thread = new Thread(task); // Pass task to the thread<br><br>thread.start(); // Start the thread<br><br>}<br><br>}<br><br>**Key Point:**<br><br>Using the Runnable interface is preferred in scenarios where your class already extends<br>another class.<br><br>**Differentiate between process and thread?**<br><br>A process and a thread are both units of execution in a computer system, but they are<br>different in several ways:<br><br>```<br>Process Thread<br>```<br>```<br>A process is a program in execution.<br>A thread is a single sequence of<br>instructions within a process.<br>```<br>```<br>The process takes more time to terminate. The thread takes less time to terminate.<br>```<br>```<br>The process takes more time for context<br>switching.<br>```<br>```<br>The thread takes less time for context<br>switching.<br>```<br>```<br>The process is less efficient in terms of<br>communication.<br>```<br>```<br>Thread is more efficient in terms of<br>communication.<br>```<br><br>```<br>Process Thread<br>```<br>```<br>The process is isolated. Threads share memory.<br>```<br>```<br>The process has its own Process Control<br>Block, Stack, and Address Space.<br>```<br>```<br>Thread has Parents’ PCB, its own Thread<br>Control Block, and Stack and common<br>Address space.<br>```<br>```<br>The process does not share data with each<br>other.<br>Threads share data with each other.<br>```<br>**Describe the life cycle of the thread? (6 states)**<br><br>A thread in Java at any point in time exists in any one of the following states. A thread lies<br>only in one of the shown states at any instant:<br><br>1. **New:** The thread has been created but has not yet started.<br>2. **Runnable:** The thread is running, executing its task, or is ready to run if there are no<br>    other higher-priority threads.<br>3. **Blocked:** The thread is temporarily suspended, waiting for a resource or an event.<br><br><br>4. **Waiting:** The thread is waiting for another thread to perform a task or for a specified<br>    amount of time to elapse.<br>5. **Terminated:** The thread has completed its task or been terminated by another<br>    thread.<br><br>**Explain suspend() method under the Thread class.**<br><br>The suspend() method of the Thread class in Java **temporarily suspends the execution** of a<br>thread.<br><br>When a thread is suspended it goes into a blocked state and it would **not be scheduled by<br>the operating system** which means that it will not be able to execute its task until it is<br>resumed.<br><br>There are **more safer and flexible alternatives** to the suspend() methods in the modern java<br>programming language. This method does not return any value.<br><br>**Syntax:**<br><br>**public final void** suspend();<br><br>**Explain the main thread under Thread class execution.**<br><br>Java provides built-in support for multithreaded programming.<br><br>The main thread is considered the parent thread of all the other threads that are created<br>during the program execution.<br><br>The main thread is automatically created when the program starts running.<br><br><br>**Why Garbage Collection is necessary in Java?**<br><br>For Java, Garbage collection is necessary **to avoid memory leaks** which can cause the<br>program to crash and become unstable.<br><br>There is no way to avoid garbage collection in Java.<br><br>Unlike C++, Garbage collection in Java helps programmers to **focus on the development** of<br>the application **instead of managing memory resources** and worrying about memory<br>leakage.<br><br>Java Virtual Machine ( **JVM** ) automatically **manages the memory periodically by running a<br>garbage collector** which frees up the unused memory in the application.<br><br>Garbage collection makes Java **memory efficient** because **it removes unreferenced objects<br>from the heap memory**.<br><br>**What is JDBC?**<br><br>JDBC **standard API** is used to link Java applications and relational databases.<br><br>It provides a **collection of classes and interfaces** that let programmers to use the Java<br>programming language to communicate with the database.<br><br>The classes and interface of JDBC allow the application to **send requests** which are made by<br>users to the specified database.<br><br>There are generally **four components** of JDBC by which it interacts with the database:<br><br>1. JDBC API<br>2. JDBC Driver manager<br>3. JDBC Test Suite<br>4. JDBC-ODBC Bridge Drivers<br><br><br>**What is JDBC Driver?**<br><br>JDBC Driver is a **software component** that is used to **enable** a Java application to interact<br>with the database.<br><br>JDBC provides the **implementation of the JDBC API** for a specific database management<br>system,<br><br>which allows it to **connect the database, execute SQL statements and retrieve data**.<br><br>There are four types of JDBC drivers:<br><br>- JDBC-ODBC Bridge driver<br>- Native-API driver<br>- Network Protocol driver<br>- Thin driver<br><br><br>**What are the steps to connect to the database in Java?**<br><br>There are certain steps to connect the database and Java Program as mentioned below:<br><br>1. **Import** the Packages<br>2. Load the drivers using the **forName()** method<br>3. Register the drivers using **DriverManager**<br>4. **Establish a connection** using the **Connection class** object<br>5. Create a statement<br>6. Execute the query<br>7. Close the connections<br><br>**What are the JDBC API components?**<br><br>JDBC API components provide various methods and interfaces for easy communication with<br>the databases also it provides packages like java Se and java EE which provides the capability<br>of write once run anywhere (WORA).<br><br><br>**Syntax:**<br><br>java.sql.*;<br><br>**What is JDBC Connection interface?**<br><br>Java database connectivity interface (JDBC) is a software component that allows Java<br>applications to interact with databases.<br><br>To enhance the connection, JDBC requires drivers for each database.<br><br>**What does the JDBC ResultSet interface?**<br><br>JDBC ResultSet interface is used to **store the data from the database** and use it in our Java<br>Program.<br><br>We can also use ResultSet to **update the data** using updateXXX() methods.<br><br>ResultSet object **points the cursor before the first row** of the result data.<br><br>Using the next() method, we can iterate through the ResultSet.<br><br>**What is the JDBC Rowset?**<br><br>A JDBC RowSet provides a way to **store the data in tabular form**.<br><br>RowSet is **an interface** in java that can be used within **the java.sql package**.<br><br>The connection between the **RowSet object and the data source** is **maintained throughout<br>its life cycle.**<br><br>RowSets are classified into five categories based on implementation mentioned below:<br><br>1. JdbcRowSet<br>2. CachedRowSet<br>3. WebRowSet<br>4. FilteredRowSet<br>5. JoinRowSet<br><br><br>6. **What is the role of the JDBC DriverManager class?**<br><br>JDBC DriverManager class **acts as an interface for users and Drivers**. It is used in many ways<br>as mentioned below:<br><br>1. It is used to create a **connection between** a Java application and the database.<br>2. Helps to **keep track of the drivers** that are available.<br>3. It can help to **establish a connection** between a database and the appropriate<br>    drivers.<br>4. It contains all the methods that can register and deregister the database driver<br>    classes.<br>5. DriverManager.registerDriver() method can maintain the list of Driver classes that<br>    have registered themselves.<br><br>**Difference between == and equals to in java**?<br><br>In Java:<br><br>- **==** : Compares **memory addresses** (references) of two objects. It checks if both<br>    variables point to the exact same object in memory.<br><br>Example:<br><br>String a = new String(&quot;hello&quot;);<br><br>String b = new String(&quot;hello&quot;);<br><br>System.out.println(a == b); // false (different objects in memory)<br><br>- **equals()** : Compares the **content** of two objects. For example, in the case of strings, it<br>    checks if the characters in the strings are the same, even if they are different objects<br>    in memory.<br><br>Example:<br><br>String a = new String(&quot;hello&quot;);<br><br>String b = new String(&quot;hello&quot;);<br><br>System.out.println(a.equals(b)); // true (same content)<br><br><br>In short:<br><br>- **==** checks if two variables refer to the same object.<br>- **equals()** checks if two objects have the same content.<br>**1. Requirement (What problem is this project solving?)**<br><br>The project solves the problem of managing core banking operations online. It provides a<br>convenient, secure, and user-friendly way for customers to perform essential banking tasks<br>like checking balance, depositing money, withdrawing cash, and mobile recharge,<br>eliminating the need to visit a bank physically.<br><br>**2. Why did you select this project?**<br><br>I chose this project because online banking has become a necessity in today&#39;s world, and I<br>wanted to understand how to build a secure, efficient, and interactive system that solves<br>real-world problems. It also gave me a chance to apply my knowledge of web development,<br>databases, and security.<br><br>**3. Basic Structure**<br><br>The project is structured into three main layers:<br><br>- **Frontend** : A user-friendly interface for customers to interact with banking features.<br>- **Backend** : Logic implemented using JSP and Servlet for processing user requests.<br>- **Database** : JDBC is used to manage and retrieve data securely from the database for<br>    transactions.<br>**4. Files, Folders, and Libraries**<br>- **Files/Folders** :<br><br><br>```<br>o JSP files for the frontend.<br>o Servlet files for handling logic.<br>o Config files for database connections.<br>```<br>- **Libraries** :<br>    o JDBC for database connectivity.<br>    o Java libraries for handling authentication and transaction logic.<br>**5. Workflow**<br>1. The user logs into the system using secure authentication.<br>2. They navigate to the desired banking feature (e.g., check balance, deposit, withdraw,<br>mobile recharge).<br>3. The system sends their request to the backend via Servlets.<br>4. The backend processes the request, interacts with the database via JDBC, and<br>updates/returns the required information.<br>5. The user receives the output on the frontend, such as a balance update or<br>confirmation message.<br><br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c33b072bf412" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resume writing]]></title>
            <link>https://medium.com/@abuhuzaifaw5/resume-writing-ab58d24de9fa?source=rss-f2cdf3af39d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab58d24de9fa</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[resume]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[resume-writing]]></category>
            <category><![CDATA[java-development]]></category>
            <dc:creator><![CDATA[Abuhuzaifa]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 17:16:04 GMT</pubDate>
            <atom:updated>2025-07-01T17:16:04.425Z</atom:updated>
            <content:encoded><![CDATA[<p>Creating an <strong>ATS-friendly (Applicant Tracking System)</strong> résumé means structuring your content in a way that both human recruiters and automated résumé scanners can read and understand easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fo09BRC-k7eHEOSwZ5ybjw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab58d24de9fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>