package com.demo.test; import java.util.Scanner; public class change { public static void main(String[] args) { s(); } public static void s() { Scanner sc = new Scanner(System.in); System.out.println("请输入:"); int week = sc.nextInt(); switch (week){ case 1: System.out.println("周一"); break; case 2: System.out.println("周二"); break; case 3: System.out.println("周三"); break; case 4: System.out.println("周四"); break; case 5: System.out.println("周五"); break; case 6: System.out.println("周六"); break; case 7: System.out.println("周七"); break; default: System.out.println("您的输入有误!"); break; } } }
跟js的Switch其实差不多的,懒的描述了,阿巴阿巴
标签:case,java,System,break,println,Switch14,out From: https://www.cnblogs.com/wencaiguagua/p/17171628.html