0

whats the problem?

import java.util.*; public class Main { public static void main(String[] args){ SimpleDateFormat sm = new SimpleDateFormat("yyyy"); Date d = new Date(); String year = sm.format (d); int IntYear = Integer.parseInt(year); if (IntYear < 2020){ System.out.println("no way"); }else{ System.out.println("ok"); } } }

27th Jun 2020, 8:11 PM
Yahel
Yahel - avatar
2 Answers
+ 2
Hello yahel You need to import SimpleDateFormat: import java.text.SimpleDateFormat;
27th Jun 2020, 8:25 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
thanks!
27th Jun 2020, 8:31 PM
Yahel
Yahel - avatar