摘要:
1 private String input;2 private BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));3 input = buffer.readLine(); 阅读全文
摘要:
java中判断字符串是否为数字的三种方法1.用JAVA自带的函数publicstaticbooleanisNumeric(Stringstr){for(inti=str.length();--i>=0;){if(!Character.isDigit(str.charAt(i))){returnfalse;}}returntrue;}2.用正则表达式public static boolean isNumeric(String str){ Pattern pattern = Pattern.compile("[0-9]*"); return pattern.matcher 阅读全文
摘要:
1 import java.io.BufferedReader; 2 import java.io.InputStreamReader; 3 import java.io.PrintWriter; 4 import java.net.ServerSocket; 5 import java.net.Socket; 6 7 8 public class Server { 9 public static void main(String[] args) {10 ServerSocket serverSocket = null;11 Socket sock... 阅读全文