We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Introduction
- Java Date and Time
- Discussions
Java Date and Time
Java Date and Time
Sort by
recency
|
1498 Discussions
|
Please Login in order to post a comment
import java.io.; import java.math.; import java.security.; import java.text.; import java.util.; import java.util.concurrent.; import java.util.function.; import java.util.regex.; import java.util.stream.*; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList;
class Result { public static String findDay(int month,int day,int year) { Calendar c=Calendar.getInstance(); String[] days={"SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"}; c.set(year,month-1,day); return days[c.get(Calendar.DAY_OF_WEEK)-1]; } }
public class Sound { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
}
i had no idea how to solve this .but thanks to this discussion board.i solved it
Use the Language as java 8
use function -LocalDate use these imports - import java.time.LocalDate; import java.time.DayOfWeek; import java.util.Locale;
code ----- LocalDate date = LocalDate.of(year, month, day); DayOfWeek dayOfWeek = date.getDayOfWeek(); return dayOfWeek.name();
Great for applications that need precise control over calendar data! Fairplay24.in login