提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
获取随机Mac地址
//package com.nowjava; /* from NowJava.com - 时 代 Java*/ import java.util.Random; public class Main { public static void main(String[] argv) throws Exception { System.out.println(getRandomMacAddress()); } public static String getRandomMacAddress() { String mac = ""; Random r = new Random(); for (int i = 0; i < 6; i++) { int n = r.nextInt(255); mac +