流程控制


public class ShunXunDemo01 {
    public static void main(String[] args) {
        System.out.println("hello1");
        System.out.println("hello1");
        System.out.println("hello1");
        System.out.println("hello1");
        System.out.println("hello1");
    }
}

按顺序打印出来
流程控制
(if单选择结构)


import java.util.Scanner;

public class IfDemo01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入内容:");
        String s = scanner.nextLine();

        //equals:判断字符串是否相等
        if (s.equals("Hello")){
            System.out.println(s);
        }
        System.out.println("End");
        scanner.close();
    }
}

判断字符串是否相等,输出的结果不一样
流程控制
流程控制


上一篇:Vue重新安装测试hello1项目(一看就懂)


下一篇:springboot 基于@Scheduled注解 实现定时任务