Core java Archive

System.out.println in java

In this post, we will see about System.out.println in java and how it works. Did you use system.out.println before? I think this is first statement every java developer compiles. It is generally called by the …

Java float vs double

In this post, we will see the difference between float and double data types in java. As you might know, float and double both can be used to represent floating point number in java. We …

Implement isPrime method in java

In this post, we will implement isPrime method.┬áisPrime method will take an integer as input and determine whether the number is prime or number. A prime number is a number which has only two divisors …

java random number between 1 and 10

We have already seen random number generator in java.In this post, we will address specific query on how to generate random number between 1 to 10. We can simply use┬áRandom class’s nextInt() method to achieve …

Segment Tree in java

In this post, we will see about Segment Tree in java. Problem Consider an Array of Integers, int arr = {a1, a2, a3, a4, a5,….., an}; Given two types of queries, (i) In the first …

Join Our News Letter - Stay Updated

Subscribe to Awesome Java Content.
You can like our facebook page Java2blog