Number
- 20 September
Convert 0 to 1 and 1 to 0 in Java
In this post, we wil see how to convert 0 to 1 and 1 to 0 in java. There are lots of ways to convert 0 to 1 and 1 to 0 in Java. Let’s go through them. Using Subtraction This is one of easiest solution to swap 0 to 1 and vice versa. Just […]
- 19 September
Count Number of Decimal Places in Java
In this post, we will see how to count number of decimal places in java. A Double can not have exact representation, you need to convert it to String to count number of decimal places in Java. There are multiple ways to count number of decimal places in java. Let’s go through them. Using String’s […]
- 16 September
How to Take Integer Input in Java
This article discusses the methods to take the integer input in Java. Variables In programs, data values are reserved in memory locations that can be identified by names (identifiers). Such named memory location which temporarily reserves data that can be changed while the program is running is called a variable. Let’s see how variables are […]
- 20 February
Format Number with Commas in Java
In this post, we will see how to format number with commas in java. How To Add Commas to Number in Java There are multiple ways to format number with commas in java. Let’s go through them. 1. Using DecimalFormat DecimalFormat can be used by providing formatting Pattern to format number with commas in java. […]
- 05 May
How to left pad Integer with zeroes in java
Learn about how to left pad Integer with zeroes in java
- 02 May
7 ways to print float to 2 decimal places in java
Learn about how to print float to 2 decimal places in java in 7 different ways.
- 22 January
Format Double to 2 Decimal Places in Java
Learn about how to format double to 2 decimal places in java
- 25 December
Find automorphic number in java
Learn about how to find automorphic number in java using different methods