How can I put the input date and print the day name only? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I put the input date and print the day name only?

How can I put the input date through Scanner class and not input the current date, I want to put the input past date through Scanner class and print the day name only, please help this problem.

7th Nov 2022, 7:35 AM
Sakshi
Sakshi - avatar
12 Answers
+ 2
You don't added any output statement. Print finalday; System.out.println(finalDay) ;
7th Nov 2022, 8:07 AM
Jayakrishna 🇮🇳
+ 3
Import missing : import java.text.DateFormat;
7th Nov 2022, 7:53 AM
Jayakrishna 🇮🇳
+ 1
And I try to many times but it gives error i don't know what's the problem in this code https://code.sololearn.com/cHwKWzFHt1lq/?ref=app
7th Nov 2022, 7:39 AM
Sakshi
Sakshi - avatar
+ 1
I import this package but now it gives no output
7th Nov 2022, 8:00 AM
Sakshi
Sakshi - avatar
+ 1
Thanks a lot
7th Nov 2022, 8:11 AM
Sakshi
Sakshi - avatar
0
compare with newer api import java.time.LocalDate; import java.time.format.DateTimeFormatter; ... DateTimeFormatter format = DateTimeFormatter.ofPattern( "dd/MM/yyyy"); LocalDate date = LocalDate.parse( inputDate, format); System.out.println( date.getDayOfWeek() );
7th Nov 2022, 9:34 AM
zemiak
0
Thank you, I will try also this code.
7th Nov 2022, 12:27 PM
Sakshi
Sakshi - avatar
0
yes
8th Nov 2022, 8:49 AM
Khalifa Bouchelliga
Khalifa Bouchelliga - avatar
0
Sorry, but this link is not open
8th Nov 2022, 8:54 AM
Sakshi
Sakshi - avatar
0
Sesao agurde serve
26th Nov 2022, 12:36 AM
ÁRLESSON ⠀
ÁRLESSON ⠀ - avatar
0
Script sucesso
26th Nov 2022, 12:36 AM
ÁRLESSON ⠀
ÁRLESSON ⠀ - avatar