if1

package Struct;

import java.util.Scanner;

public class IfDemo1 {
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();
}

}

posted @ 2021-10-19 14:45  xxm555  阅读(491)  评论(0编辑  收藏  举报