+ 6

I dont know what i have done

import java.net.InetAddress; public class Program { public static void main(String[] args)throws Exception { System.out.println(InetAddress.getLocalHost()); } }

2nd Mar 2017, 2:41 PM
Prabhakar Dev
Prabhakar Dev - avatar
2 odpowiedzi
+ 2
you just imported class inerAddress that has a method getLocalHost(),,,which prints the host name and IP address of your local machine
8th Mar 2017, 3:52 AM
Johns Maina
Johns Maina - avatar
+ 1
It prints the host name and IP address of the computer it's running on.
2nd Mar 2017, 3:21 PM
DaemonThread
DaemonThread - avatar