배열을 jsonString 형식으로 변환 ** Gson을 이용하여 변환하는 방법 public static void main(String[] args) { Gson gson = new Gson(); String a = "AAA,BBB"; String[] split = a.split(","); String json = gson.toJson(split); System.out.println(json); } BackEND/Java 2017.11.30
mac 주소 가져오기. public class MacAddressTest { public static void main(String[] args) { try { InetAddress addr = InetAddress.getLocalHost(); /* IP 주소 가져오기 */ String ipAddr = addr.getHostAddress(); System.out.println(ipAddr); /* 호스트명 가져오기 */ String hostname = addr.getHostName(); System.out.println(hostname); /* NetworkInterface를 이용하여 현재 로컬 서버에 대한 하드웨어 어드레스를 가져오기 */ NetworkInterface ni = NetworkInterface.getByInet.. BackEND/Java 2017.11.30