- 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.
8 Answers
0
String[] days=
+ 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]);
}
}
}
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]);
}
}
}
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
0
Notice that we use an array literal because we already know all the elements of the array we are going to create.
0
Adi Nath Bhawani
Don't understand yar
0