Java technology blog for core java concepts and coding best practices, and sharing knowledge for spring, struts, JAX-RS, Log4j, JUnit, Maven, Hibernate
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 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 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 is popular case that we have to process in java projects. This tutorial shows you a complete example to demo this case and package ...
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 ...
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 ...
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 ...
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 ...
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 ...