- 2

How to solve this program

Your calendar program should output all the days of week, but it has errors. Change the code so that the program prints the days.

16th Feb 2022, 2:24 AM
Ujawal Tiwari
Ujawal Tiwari - avatar
8 Answers
0
String[] days=
16th Feb 2022, 3:44 AM
Adi Nath Bhawani
Adi Nath Bhawani - avatar
+ 2
public class Main { public static void main(String[] args) { String[] days = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; for (int i = 0; i < 7; i++) { System.out.println(days[i]); } } }
16th Feb 2022, 3:50 AM
Adi Nath Bhawani
Adi Nath Bhawani - avatar
0
public class Main { public static void main(String[] args) { int[] days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; for (int i = 0; i < 7; i++) { System.out.println(days[i]); } } }
16th Feb 2022, 3:12 AM
Ujawal Tiwari
Ujawal Tiwari - avatar
0
Jay Matthews public class Main { public static void main(String[] args) { int[] days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; for (int i = 0; i < 7; i++) { System.out.println(days[i]); } } } This is code
16th Feb 2022, 3:13 AM
Ujawal Tiwari
Ujawal Tiwari - avatar
0
Notice that we use an array literal because we already know all the elements of the array we are going to create.
16th Feb 2022, 3:14 AM
Ujawal Tiwari
Ujawal Tiwari - avatar
0
Adi Nath Bhawani Don't understand yar
16th Feb 2022, 3:46 AM
Ujawal Tiwari
Ujawal Tiwari - avatar
0
purveshKolhe Jay Matthews Adi Nath Bhawani Please solve and correct this problem ą„¤ Code
16th Feb 2022, 3:47 AM
Ujawal Tiwari
Ujawal Tiwari - avatar