As per Javadoc java.sql.Date is a thin wrapper around millisecond value which is used by JDBC to identify an SQL DATE type.
java.sql.Date just represent DATE without time information while java.util.Date represents both Date and Time information. This is the major difference why java.util.Date can not directly map to java.sql.Date.
To suppress time information and to confirm with the definition of ANSI SQL DATE type, the millisecond values used in java.sql.Date instance must be "normalized by setting the hours, minutes, seconds and milliseconds to zero in the time-zone with DATE instance is associated. In other words, all time-related information is removed from java.sql.Date class.
I hope this will help you to understand the difference.
You can use Joda Time Library.
Interval i ...READ MORE
String are immutable where as StringBuffer and ...READ MORE
Hashtable is synchronized, whereas HashMap is not. This makes HashMap better for ...READ MORE
While programming we often write code that ...READ MORE
Use java.time classes instead of java.util.Date & java.sql.Date with JDBC 4.2 or ...READ MORE
You can convert a String to int by using a function:
int ...READ MORE
We can do this in 2 ways:
String ...READ MORE
Double temp = Double.valueOf(str);
number = temp.doubleValue(); READ MORE
I understand your doubt regarding map ...READ MORE
BufferedReader is synchronous while Scanner is not.
BufferedReader ...READ MORE