*UPDATE*I have an instance in my class java.util.Date shippingDate which I need to compare whether it is equal to current date or not.
java.util.Date shippingDate ;
Calendar g = new GregorianCalendar();
shippingDate=g.getTime();
if(shippingDate.equals(new Date()))
{
System.out.println("Match found");
}
Equals is overridden in Date, so it should execute the sysout.But its not printing anything.
PS#I am not allowed to use Joda Time library.
UPDATE- Is there any other way to compare shippingDate with current Date. I don't want to hardcode the current date using SimpleDateFormat. It has to be generated from system.
Dateclass.new Date()back to back, and you will get the idea.