0
String ="12-12-1212"; // as input

Date date="12-12-1212"  //as output

or

how to take input in Java.util.date in the form of dd-mm-yyyy form

azro
  • 53,056
  • 7
  • 34
  • 70
vishant
  • 11
  • 1
  • 4
    There is DOZENS of example on this forum, and DOZENS outside this forum – azro Apr 10 '18 at 09:47
  • Welcome to Stack Overflow! Please search the site and/or the net. This question has been covered many times already, so you’ll find a good answer out there quickly. – Ole V.V. Apr 10 '18 at 09:47
  • Why do you want a `Date` object? The `Date` class is long outdated. I recommend [`java.time`](https://docs.oracle.com/javase/tutorial/datetime/) and its `LocalDate` class instead. `java.time` is the modern Java date and time API. – Ole V.V. Apr 10 '18 at 09:49

0 Answers0