String to Date in Java

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
 
public class StringToDate {
        public static void main(String args[]){
                String strDate = "21/08/2011";
               
                try{                   
                        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
                        Date date = sdf.parse(strDate);
                        System.out.println("Date is: " + date);
 
                }catch(ParseException e){
                        System.out.println("Java String could not be converted to Date: " + e);
                }
        }
}