#
Core java Archive

In this post ,we will try to understand hashcode() and equals() method in java. Java HashMap: HashMap in java How HashMap works in java hash and indexfor method in HashMap hashcode and equals method in …

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 …

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 …

You can use Character class’s toLowerCase method to convert char to lowercase in java. Method signature Parameters ch is primitive character type. Return type return type is char. If char is already lowercase then …

You can use Charater class’s touppercase method to convert char to uppercase in java. Method signature Parameters ch is primitive character type. Return type return type is char. If char is already uppercase then …

Character class’s isletter method can be used to check if character is letter or not. Method signature Parameters ch is primitive character type. Return type boolean is primitive character type. When you run …

In this post, we will see how to solve cannot make static reference to non-static method. Let’s understand this error with the help of example. Above program won’t compile and you will get below …

In this post, we will see how to implement distance formula between two points in java. Formula to find distance between two points ( x1, y1) and (x2 , y2) is d= sqrt( (x2-x1)^2+ (y2 …

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 …

In this post, we will see how to calculate total surface area of Cylinder in java. Formula of calculating total surface area of Cylinder is: Surface area of Cylinder = 2 *Π * r * …

In this post, we will see how to get random number between 0 to 1 in java. We have already seen random number generator in java. We can simply use Math.random() method to get random …