Java Common

  • What are all the different ways to create an object in Java

    What are all the different ways to create an object in Java? This is one of popular questions in any Java Core interview. We all know how to create objects ...
  • How to loop a Map in Java

    How to loop a Map in Java or How many ways to loop Map in Java are most important questions in any Java interview. It’s require a developer to list ...
  • Convert Date to String in Java

    Convert Date to String in Java is a continuation of the previous post. Here we show you how to convert date to string in java by creating a complete example ...
  • Convert String to date in Java

    Convert string to date in java is popular case that we have to process in java projects. This tutorial shows you a complete example to demo this case and package ...
  • How to sort Hashmap by key in Java

    This tutorial shows you how to sort hashmap by key in java using java.util.TreeMap. Beside it also shows how to sort a hashmap in Ascending or Descending order by key ...
  • Sort arraylist and collection in java (Comparable and Comparator)

    This tutorial shows the use java.lang.Comparable and java.util.Comparator to sort arraylist and collection in java. The arraylist or collection may contain primitive data, string or user defined object. Here is ...
  • Create instance using class name in Java

    You can create instance using class name if Java knows about the class (the class is stored somewhere of the classpath, ie) within the application context. Thus, you can ...
  • Two ways compare Java Double

    This sample shows two ways compare Java Double object with another Double object or two dobule primitive values using methods of java.lang.Double class package com.javabycode.common;public class JavaDoubleCompare {public static ...
  • How to loop collection using Iterator object?

    I show you three ways to loop collection using Iterator object. Hope you like and choose one to implement for your code. Although there are other ways to do but ...
Please share it if you found this useful
Hide Buttons