I dont know what i have done | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answers
+ 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