S
S
Sergey Sergey2021-04-26 12:21:42
Java
Sergey Sergey, 2021-04-26 12:21:42

Is this correct as the beginning of writing a calendar?

public class Calendar {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String[] months = {"ЯНВАРЬ", "ФЕВРАЛЬ", "МАРТ", "АПРЕЛЬ", "МАЙ",
            "ИЮНЬ", "ИЮЛЬ", "АВГУСТ", "СЕНТЯБРЬ", "ОКТЯБРЬ", "НОЯБРЬ", "ДЕКАБРЬ"};
        
        int[] days = {1};
        
        String[] weeks = {"Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"};
        System.out.println(+ days[0] +  months[0] + weeks[4]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-04-26
@Sergei1111

I answered you earlier in one of your questions and even asked a counter question.
To write a calendar for 5 years (output all 5 years through a for loop) or output one year through a loop and the rest ... how to write?

To be honest, it seems to me that you are not implementing the calendar in the right way, because of which, let me ask, what kind of calendar do you write?

Accordingly, if you are writing a JavaFX application, then this is one thing, if a console application, then this is another, but if an android application, then this is also another.
Also in my answer, I pointed out that there are classes for working with date, time and calendar. (read my answer at the link above).
Having dealt with the answer, it will become clear to you what exactly you expect to see in the final result.
Here, here is an example of a console application - https://stackoverflow.com/questions/26962388/print...
Taking into account the above, I answer your question:
Is this correct as the beginning of writing a calendar?

The question needs to be clarified and indicate the final goal that you want to achieve. And then we will try to help you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question