Author: misamaliraza94

  • Collection Interface

    In this tutorial, we will learn about the Java Collection interface and its subinterfaces. The Collection interface is the root interface of the Java collections framework. There is no direct implementation of this interface. However, it is implemented through its subinterfaces like List, Set, and Queue. For example, the ArrayList class implements the List interface which is a subinterface of the Collection Interface. Subinterfaces of Collection…

  • Collections Framework

    In this tutorial, we will learn about different interfaces of the Java collections framework. The Java collections framework provides a set of interfaces and classes to implement various data structures and algorithms. For example, the LinkedList class of the collections framework provides the implementation of the doubly-linked list data structure. Interfaces of Collections FrameWork The Java collections framework provides…

  • Throw and throws

    In this tutorial, we will learn to use throw and throws keyword for exception handling with the help of examples. In Java, exceptions can be categorized into two types: Unchecked Exceptions: They are not checked at compile-time but at run-time.For example: ArithmeticException, NullPointerException, ArrayIndexOutOfBoundsException, exceptions under Error class, etc. Checked Exceptions: They are checked at compile-time. For example, IOException, InterruptedException, etc. Refer to Java Exceptions to…

  • Try…catch

    In this tutorial, we will learn about the try catch statement in Java with the help of examples. The try…catch block in Java is used to handle exceptions and prevents the abnormal termination of the program. Here’s the syntax of a try…catch block in Java. The try block includes the code that might generate an exception. The catch block includes the code that…

  • Java Exception Handling

    In the tutorial, we will learn about different approaches of exception handling in Java with the help of examples. In the last tutorial, we learned about Java exceptions. We know that exceptions abnormally terminate the execution of a program. This is why it is important to handle exceptions. Here’s a list of different approaches to handle…

  • Java Reflection

    In this tutorial, we will learn reflection, a feature in Java programming that allows us to inspect and modify classes, methods, etc. In Java, reflection allows us to inspect and manipulate classes, interfaces, constructors, methods, and fields at run time. There is a class in Java named Class that keeps all the information about objects and classes…

  • Java enum Strings

    In this tutorial, we will learn to learn about string values for enum constants. We will also learn to override default string value for enum constants with the help of examples. Java enum Strings Before you learn about enum strings, make sure to know about Java enum. In Java, we can get the string representation of…

  • Java enum Constructor

    In this Java tutorial, you can learn about enum constructors with the help of a working example. Before you learn about enum constructors, make sure to know about Java enums. In Java, an enum class may include a constructor like a regular class. These enum constructors are either private – accessible within the classor package-private – accessible within…

  • Java enums

    In this tutorial, we will learn about enums in Java. We will learn to create and use enums and enum classes with the help of examples. In Java, an enum (short for enumeration) is a type that has a fixed set of constant values. We use the enum keyword to declare enums. For example, Here, we have…