I am getting error for cannot find symbol
getInstance(),Calendar.DATE,Calendar.MONTH,Calendar.YEAR
This only occurs when I am running offline on VS Code. On running in on an online IDE (Hacker Rank), I get compilation successful. JDK 11 on desktop, JDK 8 on Hacker Rank. I have tried running it on multiple IDEs and get compilation successful only on JDK 8
import java.util.*;
import java.lang.*;
import java.io.*;
class Calendar {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int day = sc.nextInt();
int month = sc.nextInt();
int year = sc.nextInt();
Calendar c = Calendar.getInstance();
c.set(Calendar.DATE, day);
c.set(Calendar.MONTH, month - 1);
c.set(Calendar.YEAR, year);
System.out.println(c.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, new Locale("en", "US")).toUpperCase());
}
}