001package bradleyross.demonstrations;
002import java.net.InetAddress;
003/**
004 * See what information I can get about local system.
005 * @author Bradley Ross
006 *
007 */
008public class Address extends Object
009{
010
011        /**
012         * @param args Not used
013         */
014        public static void main(String[] args) {
015                try
016                {
017                        InetAddress local = InetAddress.getLocalHost();
018                        System.out.println("Canonical host name is " + local.getCanonicalHostName());
019                        System.out.println("Host name is " + local.getHostName());
020                        System.out.println("OS name is " + System.getProperty("os.name"));
021                }
022                catch (Exception e)
023                {
024                        System.out.println(e.getClass().getName());
025                        System.out.println(e.getMessage());
026                        e.printStackTrace(System.out);
027                }
028
029        }
030
031}