• How to write binary files in C++
    14 March

    Write Binary Files in C++

    In this post, we will see how to write binary files in java. The binary files are similar to the text files however the content in binary files is stored in binary format rather than simple text format. The binary files can come in handy for storing complex objects such as structures, and classes. This […]

  • Check if Object is null Java
    14 March

    Check if Object Is Null in Java

    1. Introduction to the Problem Statement In Java programming, handling null references is essential for preventing the dreaded NullPointerException. Suppose we have an object, MyObject. Our objective is to determine whether MyObject is null. The expected output is a boolean value indicating the null status of the object. This article explores several methods for checking […]

  • Java random number between 1 and 100
    07 March

    Random Number Between 1 and 100 in Java

    TL;DR To generate random number between 1 and 100 in java, you can use Math.random() method. [crayon-6729ad23cf534754260813/] Output: Random number between 1 and 100: 26 Math.random Java between 1 and 100 Java provides the Math class to perform all sorts of mathematical operations. The class also has a method named random() that produces pseudo-random numbers […]