Java: convert birth data to days

后端 未结 4 546
春和景丽
春和景丽 2021-01-17 06:11

I really need some help with the specific assignment. The user inputs birth data (YYYY MM DD) and the program tells you how old you are in days :

The outprint in co

4条回答
  •  没有蜡笔的小新
    2021-01-17 07:13

    Well, when I imported the needed class, it worked just fine:

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

    The error Eclipse gave you is probably because you didn't import the correct classes.

    A little hint: use ctrl + shift + o to add missing imports in eclipse

提交回复
热议问题