How to generate pseudorandom numbers in Java ?

How to generate pseudorandom numbers in Java ?
DeeKay January 3, 2017 at 8:45 pm · How To, java.math, java.util, Other

In this post we will see how to generate pseudorandom numbers in Java. Before that we will see what is Random numbers. Random numbers are the numbers that occur in sequence such that the values are uniformly distributed over a defined interval or set, which is impossible to predict future values based on present and…
Continue Reading »


What is the difference between HashTable and HashMap in Java?

What is the difference between HashTable and HashMap in Java?
DeeKay December 2, 2016 at 3:12 am · java.util

Both HashTable and HashMap are java collections and implements java.util.Map interface. Difference between HashTable and HashMap is the most common interview question. Many of the candidates who face the interview struggle to answer this question. Difference between HashTable and HashMap in Java Thread Safe: HashTable is thread-safe and can be shared between multiple threads but…
Continue Reading »


How to Sort a Map by key in Java?

How to Sort a Map by key in Java?
DeeKay November 20, 2016 at 2:00 am · java.util, sorting

Here we will see how to sort a Map by key in java. There are two ways to sort a Map by Key –   First Approach Second Approach


How to use Preferences API to store application/Program configurations ?

How to use Preferences API to store application/Program configurations ?
DeeKay October 16, 2013 at 3:32 am · java.util

Introduction Preferences (Java.util.pref) API is included in JDK can be used to remember and retrieve application preferences. Using this API you can manage preference data such as storing, retrieving, removing and cleaning preference data. This API is not intended to save application data. Also it reduces the burden of application developer to write the code…
Continue Reading »


How to convert Array to List in java?

How to convert Array to List in java?
DeeKay October 6, 2011 at 7:39 pm · java.util

Below code example show how to convert an array to List in java. To convert array based data into list, we can use java.util.Arrays class. This class provide a static method asList(Object[] a) that converts array into list. OUTPUT: TOM JACK JILL JANE


How to convert an array into a collection object?

How to convert an array into a collection object?
DeeKay October 6, 2011 at 7:33 pm · java.util

Below java code example show how to convert an array into a Collection object. To convert array based data into list / collection, we can use java.util.Arrays class. This class provide a static method asList(Object[] a) that converts array into list / collection. OUTPUT: TOM JACK JILL JANE


How to get Date/Day, Month and Year of the current date?

How to get Date/Day, Month and Year of the current date?
DeeKay October 6, 2011 at 6:22 pm · java.util

Below java code example shows how to get date, month and year from the current date


How to convert String to Date in java?

How to convert String to Date in java?
DeeKay October 5, 2011 at 11:15 pm · java.util

Below java code shows how to convert String to Date Object. It converts String Object to java.util.Date