

Java isNumeric method
In this post, we will see how to implement isNumeric method in java. There are many way to check if String is numeric or not. Let’s see one by one. Using regular expressions You can use below regular expression to check if string is numeric or not. [-+]?\\d*\\.?\\d+ package org.arpit.java2blog; public class JavaisNumericMain { public static void main(String...
Convert decimal to binary in java
In this post, we will see how to convert decimal to binary in java. There are lot of ways to convert decimal to binary in java.Let’s explore them one by one. Using Integer.toBinaryString() method You can simply use inbuilt Integer.toBinaryString() method to convert a decimalpackage org.arpit.java2blog; public class DecimalToBinaryInBuiltMain { public static void main(String[] args)...
Print prime numbers from 1 to 100 in java
In this program, we will print prime numbers from 1 to 100 in java. A prime number is a number which has only two divisors 1 and itself. To check if the number is prime or not, we need to see if it has any other factors other than 1 or itself. If it has, then number is not prime else number is prime. Algorithm Iterate from 1 to 100. In each iteration, check is number is prime or not. If number...
What is Xms and Xmx parameter in java?
In this post, we will see about Xms and Xmx parameter in java. -Xmx specifies maximum memory size for Java virtual machine (JVM), while -Xms specifies the initial memory size. It means JVM will be started with Xms amount of memory and JVM will be able to use maximum of JVM amount of memory. Let’s understand this with help of example. java -Xms512m -Xmx1024m So java process will start with 512...