Convert String to Date format in Java

Java Code for Converting String to Date format:

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author www.tekhnologia.com
 */

public class ConverterClass {
   
    public void stringToDate(int date, int month, int year) {
       
        SimpleDateFormat dateFormat = new SimpleDateFormat(“dd/MM/yyyy”);

        String strDate = date + “/” + month + “/” + year;
        try {
           
            Date dateForm = dateFormat.parse(strDate);
            System.out.println(“New Date = ” + dateFormat.format(dateForm));
           
        } catch (ParseException e) {
            e.printStackTrace();
        }
       
    }

   public static void main(String[] args) {
        new ConverterClass().stringToDate(29, 11, 1982);
    }
}

Out put will be : New Date = 29/11/1982