System.out.println("你的电脑cpu数量为:"+Runtime.getRuntime().availableProcessors()); 在我的电脑上执行后显示结果: 你的电脑cpu数量为:2 电脑cpu-z截图