0

How to run all testcases at once

Unable to run 2 test cases at once Need help.... Convert US date to EU date https://code.sololearn.com/cc0MPnOTg0hJ/?ref=app

8th Jan 2020, 3:35 AM
Salman Mohammad
Salman Mohammad - avatar
3 ответов
0
Create a new method outside main() that takes a string input and prints the result, containing all the program logic. Use the main() function to call this method multiple times with different parameters.
8th Jan 2020, 4:42 AM
Tibor Santa
Tibor Santa - avatar
0
// public void format(String dateStr) { //... } //... main(...) p.format("25/11/2019"); p.format("1/1/2021"); } ---------- but this is wrong: //formatter = new SimpleDateFormat("25/11/2019"); "25/11/2019"is not a meaningful parse format like ("M/d/y") you need assign Date object: try { date = formatter.parse(dateStr); //dateStr = "25/11/2019"
9th Jan 2020, 8:33 AM
zemiak
0
EDIT
9th Jan 2020, 8:57 AM
zemiak