int i = 3; String result = new String(); switch (i) { case 1: result = result + "him "; case 2: result = result + "her "; case 3: result = result + "it "; default: result = result + "me "; } System.out.println(result);
it me
him her it me
him her
me
switch穿透
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题