Author: Mohtashim Nawaz
- 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 […]
- 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 […]
- 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-673fb3069514e374257231/] 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 […]