Question: I have a date [format - dd/mm/yyyy]. I need to compare it with the current date so that I can execute this logic 

```
if(end date is in the future) {
//logic
} else {
//logic
} 

```

Can we do this in JAVA ?

Answer: 
It looks like you are starting with a string so you can use [SimpleDateFormat.parse](http://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html#parse%28java.lang.String,%20java.text.ParsePosition%29) to convert the String to a Date.

Then you can use the [compareTo](http://docs.oracle.com/javase/7/docs/api/java/util/Date.html#compareTo%28java.util.Date%29) function on the Date class to see if it is in the past or not.

Something like the below (I havent compiled this...)

```
if (new SimpleDateFormat("dd/MM/yyy").parse(yourSring).compareTo(new Date()) > 0) {
   ...
}

```

If possible I would always use JodaTime thought instead of the Java Date and Calendar classes. It is much easier to use.
use compareto method to compare two dates. 
check here in [Date API](http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Date.html)

```
if(curreDate.compareTo(thisdate)>0) {
// do your logic
}

```