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"); } } }
2 Respostas
+ 2
Hello yahel
You need to import SimpleDateFormat:
import java.text.SimpleDateFormat;
+ 1
thanks!