S
S
Sergey Sergey2021-09-24 09:01:06
Java
Sergey Sergey, 2021-09-24 09:01:06

This code in the IDE emphasizes the getInstance();?

package javaapplication;
import java.util.*;
import static java.lang.System.out;
/**
 *
 * @author Сергей
 */
public class FulMoons {
    static int DAY_IM = 1000 * 60 * 60 * 24;
    public static void main(String[] args){
        Calendar c = new Calendar.getInstance();
        c.set(2004, 1, 7, 15, 40);
        long day1 = c.getTimeInMillis();
        day1 += (DAY_IM * 29.52);
        c.setTimeInMillis(day1);
        for(int x = 0; x < 60; x++){
           out.println(String.format("Полнолуние было в %tc", c)); 
        }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-09-24
@Sergei1111

Because getInstance is not a constructor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question