Answer to Question #319975 in Java | JSP | JSF for Sammy

Question #319975

Write a program to display the days of the week

You are to upload only the .java file

1
Expert's answer
2022-03-29T02:10:29-0400
public class Main {
    public static void main(String[] args) {

        WeekDays weekDays = new WeekDays();
        weekDays.show();
    }
}


class WeekDays{

    public String[] weekDays = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
     public void show(){
         for (String s : weekDays) {
             System.out.println(s);
         }

     }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS