IF单选则结构代码
public class demo02 {
public static void main(String[] args) {
//if单选则结构
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();
}
}