摘要:
自己的实现1package rainbow.test;import rainbow.test.foods;public class ThreadTest1 { public static void main(String[] args) { foods foo = new foods(); new pro(foo).start(); new cons(foo).start(); }}class pro extends Thread{ foods foo = null; public pro(foods foo){ this.foo = foo; } @Override public void 阅读全文
摘要:
eclipse中编译出现该问题检查自己的类名...我的问题是使用了 类名: concon是操作系统保留的一个设备名字,不可以使用该类名..其他的比如CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9都不可以. 阅读全文
摘要:
public static String getMacOnWindow() { try { String mac = null; Process process = Runtime.getRuntime().exec("ipconfig /all"); BufferedReader buffer = new BufferedReader(new InputStreamReader(process.getInputStream())); for (String line = buffer.readLine(); line != null; line = buffer.read 阅读全文