• 02 October

    Initialize ArrayList with values in Java

    In this article, we will learn to initialize ArrayList with values in Java. ArrayList is an implementation class of List interface in Java. It is used to store elements. It is based on a dynamic array concept that grows accordingly. We can Initialize ArrayList with values in several ways. Let’s see some of them with […]

  • Get Thread Id in Java
    30 September

    Get Thread Id in Java

    In this article, we will learn to get thread id of a running thread in Java. An Id is a unique positive number generated at the time of thread creation. This id remains unchanged during the lifetime of the thread. When a thread gets terminated its id can be used to refer another thread, but […]

  • 30 September

    How to compare characters in Java

    Learn about how to compare characters in java using different methods.

  • 30 September

    Find Perfect Number in Java

    In this article, we are going to find whether a number is perfect or not using Java. A number is called a perfect number if the sum of its divisors is equal to the number. The sum of divisors excludes the number. There may be several approaches to find the perfect number. For example: 28 […]

  • 29 September

    Input validation in java using Scanner

    In this post, we will see how to do input validation in java using Scanner class. The Java Scanner class is used to get input from user. It provides several methods to get input of different types and to validate the input as well. Here we will see some of these methods that can be […]

  • 28 September

    How to find Magic Number in Java

    In this article, we are going to learn to find Magic Number using Java. Let’s first understand, what is Magic Number? What is a Magic Number? A number which leaves 1 as a result after a sequence of steps and in each step number is replaced by the sum of its digits. For example, if […]

  • 28 September

    Number guessing game in java

    In this article, we will implement Number guessing game in java. The number guessing game is based on a concept where player guesses a number between a range. If player guesses the exact number then player wins else player looses the game. Since this game provides limited attempts, so, player must guess the number with […]

  • 25 September

    Reference Variable in Java

    In this post, we will see about Reference variable in java. Reference variable A variable that holds reference of an object is called a reference variable. Variable is a name that is used to hold a value of any type during program execution. If the type is an object, then the variable is called reference […]

  • 24 September

    Missing return statement in java

    In Java, missing return statement is a common error which occurs if either we forget to add return statement or use in the wrong scenario. In this article, we will see the different scenarios whenmissing return statement can occur. Missing return statement Here are the few scenarios where we can get Missing return statement error. […]