• 08 September

    5 best java programming books

    For nearly a decade Java has continued to be one of the most popular programming languages. Java is extensively used for the back-end infrastructure of business applications, web applications, and embedded systems. It is the building block of Android and continues to evolve as a foundation with the introduction of new features and versions, the […]

  • 07 September

    Power function in java

    Power function in java is used to get first argument’s power to 2nd argument. For example: Let’s say you want to calculate 2 to the power 4. That will be 2*2*2*2=16 In java, you can do it by : Math.pow(2,4) =16 Syntax [crayon-662b35ba2de9f727879020/] Example : Let’s use power function in java. [crayon-662b35ba2dea8206568404/] When you run […]

  • 03 September

    Java Generics tutorial

    In this post, we will see about Java Generics tutorial with a lot of examples. Generics in java ‘Generics’ is a term that is quite common nowadays. Grammatically, it a collective of the word ‘generic’ which means a certain characteristic which is not very specific and can be used to denote a certain range or […]

  • 02 September

    Java Math random example

    In this post, we will see about Java math random example. Math’s random method provides you positive signed double value from 0.0 to 1.0. Syntax [crayon-662b35ba33319083222453/] This method can be used in multithreaded environment as it is thread safe. If you see the source code for random math, you will see that it uses java.util.Random […]

  • 02 September

    Java Math ceil example

    Java math ceil function is used to get smallest integer which is greater than number. Real life example Let’s say a telephone company charges you 1 dollar per minute. When you talk to someone for 1 minute 5 seconds, it will still charge you 2 dollar for that call. So telephone company can use Math.ceil […]

  • 02 September

    Java Math floor example

    Java math floor function is used to get largest integer which is lesser than number. Syntax [crayon-662b35ba37097936924637/] Example Let’s use math’s floor function in the example. [crayon-662b35ba370a0718596169/] When you run above program, output of the program will be: Ceil value for 2.6 = 3.0 Ceil value for 26.1 = 27.0 Ceil value for -0.8 = […]

  • 26 August

    Copy Constructor in java

    In this post, we will see about copy constructor in java. Copy constructor is the constructor which takes parameter as object of same class and copy each field of the class to the new object. Unlike C++, java does not provide default copy contructor. You need to create one, if you want to have copy […]

  • 26 August

    Java default constructor

    In this post, we will see about Java default constructor. Default constructor is the no arg constructor which is inserted by compiler unless you provide any other constructor explicitly. You won’t able to see it as it is present in class file rather than source file. Is there any difference between no argument constructor and […]

  • 23 August

    Sort array in java

    In this post, we will see how to sort an array in java. There are various ways to sort array in java. You can implement different sorting algorithms to sort an array. You can use Arrays.sort method to sort array in java. There are various overloaded versions of Arrays.sort method. You can go through it […]