import java.net.InetAddress; import java.net.UnknownHostException; /** * Name: TODO - Put your name here * Program: Homework1 * Description: This is the networking homework1 assignment to get some basic * networking information from the student.cs.uni.edu server. */ public class Homework1 { public static void main(String[] args) { InetAddress ip; String hostname; try { /* Get the ip address using InetAddress.getLocalHost() ip = TODO: FILL IN */ /* Get the host name using InetAddress.getHostName() hostname = TODO: FILL IN */ /* Print the results -- will only work if ip and hostname filled in */ System.out.println("Your current IP address : " + ip); System.out.println("Your current Hostname : " + hostname); } catch (UnknownHostException e) { e.printStackTrace(); } } }