@KarthickM6092 - Good one Karthick. I like the OOTB function with "EEEEE" option. Looks like something missed from your java code, that is fine. Here is another way of writing the java code for the same context. Result is the Local parameter in Pega and we can define it in the activity and print on the screen using Show-Property.
java.util.Date date = new java.util.Date();
String tempDate = date.toString();
java.time.LocalDate date = java.time.LocalDate.parse(tempDate);
java.time.DayOfWeek day = date.getDayOfWeek();