How to enter a LocalDate value into BlueJ “Create Object” dialog box

后端 未结 2 647
一向
一向 2021-01-27 03:26

I\'m not trying to format the date in YYYY-MM-DD or dd/MM/YYYY. I\'m asking about the literal format of LocalDate.

I just started learning Java and I am using this IDE c

2条回答
  •  被撕碎了的回忆
    2021-01-27 04:28

    Try converting the LocalDate in the call, such as:

    TestPaper (2018-05-30, LocalDate.parse("2018/05/30"), 30/05/2018);
    

    There are other static methods within LocalDate you can use. See here for more examples.

    From your comment above, don't forget your import:

    import java.time.LocalDate;
    

提交回复
热议问题