⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 repeat.java

📁 Usefull sample codes for Java. Containt all type of programs.
💻 JAVA
字号:
import java.util.*;

class Repeat {
    public static void main(String[] arguments) {
        String sentence = "Thorium 230 is not a toy.";
        int count = 10;
        Calendar start = Calendar.getInstance();
        int startMinute = start.get(Calendar.MINUTE);
        int startSecond = start.get(Calendar.SECOND);
        start.roll(Calendar.MINUTE, true);
        int nextMinute = start.get(Calendar.MINUTE);
        int nextSecond = start.get(Calendar.SECOND);
        while (count < 1000000) {
            System.out.println(sentence);
            GregorianCalendar now = new GregorianCalendar();
            if (now.get(Calendar.MINUTE) >= nextMinute) {
                if (now.get(Calendar.SECOND) >= nextSecond) {
                    break;
                }
            }
            count++;
        }
        System.out.println("\nI wrote the sentence " + count
            + " times.");
        System.out.println("I have learned my lesson.");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -