• 01 April

    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 will see the difference between float and double and also when to use double vs float. Similarities between double and […]

  • 31 March

    Where is java installed on mac

    In this post, we will see where is java installed on mac. If you have the following questions, then this post will help you. What version of Java do I have How to check Java version on mac Where is Java installed on mac How to find Java version on mac Do I have Java […]

  • FizzBuzz Java
    31 March

    FizzBuzz program in java

    In this post, we will see how to program FizzBuzz in java. Fizzbuzz is a fun game played generally by school children. It is simple game in which when your turn comes, you need to say the next number. So here are rules of the game: If number is divisible by 3, then you need […]

  • 30 March

    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 1 and itself. To check if the number is prime or not, we need to see if it has any […]

  • 30 March

    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. Using random.nextInt() to generate random number between 1 and 10 We can simply use Random class’s nextInt() method to achieve this. As the documentation says, this method call returns "a […]

  • 28 March

    Sort an array of 0s, 1s and 2s

    If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this post, we will see how to sort an array of 0s, 1s and 2s.We have already seen a post on sort 0s and 1s in an array. Problem Given an array containing zeroes, ones and twos […]

  • 27 March

    Could not find or load main class

    In this post, we will discuss Could not find or load main class. Did you get this error before? If you have good amount of experience in Java programming or as a novice java developer, you might have encountered this error: Could not find or load main class. Before we understand about this error, let’s first […]

  • 10 March

    Print pyramid pattern: 1 3*2 4*5*6 pattern in java

    In this post, we will see how to print the following pyramid pattern. Problem Input : n = 4 Output : 1 3*2 4*5*6 10*9*8*7Input : n = 5 Output : 1 3*2 4*5*6 10*9*8*7 11*12*13*14*15 Solution If you notice the pattern we need to print odd rows in increasing order and even rows in […]

  • 04 March

    Check if it is possible to reach end of given Array by Jumping

    If you want to practice data structure and algorithm programs, you can go through Java coding interview questions.   Problem Given an array with positive integers as elements indicating the maximum length of a jump which can be made from any position in the array. Check if it is possible to have a jumps combination […]