在看Thinking in Java,有一段实在没看懂package com.company.allAreTheObjective.Symbol;import java.util.*;/** * Created by Francis on 12/05/2016. */public class VowelsAndConsonants { public static void main(String args[]){ Random rand = new Random(47); for (int i = 0; i < 100; i++){ int c = rand.nextInt(26) + 'a'; System.out.print((char)c+","+ c +":"); switch(c){ case 'u' : System.out.println("vowel");break; case 'w' : System.out.println("Sometimes a vowel");break; default : System.out.println("constant"); } } }}这一段为什么输出恒为y,121:constantn,110:constantz,122:constantb,98:constantr,114:constantn,110:constanty,121:constant
添加回答
举报
0/150
提交
取消