[英]how can I use switch case in less code using java?
here is the question:这是问题:
Enter any character from keyboard, using switch case find whether charcater type:从键盘输入任何字符,使用 switch case 查找是否字符类型:
alphabet , digit , arithmetic operator or relation operator or any special character ?字母、数字、算术运算符或关系运算符或任何特殊字符?
find if it is alphabet it is uppercase or lower case查找是字母表是大写还是小写
Look at the java java.lang.Character class.查看 java java.lang.Character 类。 There are methods isLetter(), isDigit(), isWhitespace(), etc. static methods which should help coalesce your code greatly.
有方法 isLetter(), isDigit(), isWhitespace() 等静态方法应该有助于极大地合并您的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.