diff src/test/getLocalAddress.java @ 0:756bfaf731f3

create new repository
author Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
date Tue, 21 Feb 2012 04:10:12 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/getLocalAddress.java	Tue Feb 21 04:10:12 2012 +0900
@@ -0,0 +1,16 @@
+package test;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+public class getLocalAddress {
+	public static void main(String[] argv) {
+		try {
+			InetAddress addr = InetAddress.getLocalHost();
+			System.out.println(addr);
+		} catch (UnknownHostException e) {
+			e.printStackTrace();
+		}
+
+	}
+}