• 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

    PI in Java

    The Pi is a constant value in Mathematics that represents a floating-point value 3.1415. It is mostly used in geometry to calculate area, circumference, volume, etc. If you have studied geometry in your academic, then you may be aware of use of Pi such as calculating area require this constant value. In Java, when we […]

  • 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. […]

  • 24 September

    Java 9 – Process API Improvements

    In this post, we will see about Java 9 process API improvements. Java improved its Process API in Java 9 version that includes new methods for Process class and two new interfaces ProcessHandle and ProcessHandle.Info. These methods are used to create a new process and get process information like process status, running time, process id, […]

  • 19 September

    Java try with resources

    In this post, we will see about Java try with resources Statement. Java try with resources is a feature of Java which was added into Java 7. It helps to close all the resources declared within try block. It automatically closes the resources after being used. A resource can be any file or a database […]