Disqus Shortname

Pemrograman Jaringan Dengan Java (ip)

Mencari Alamat IP

import java.net.*;
import java.io.*;
public class ip{
public static void main(String args[]) throws IOException{
String host;
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter host name :");
host = input.readLine();
try{
InetAddress address = InetAddress.getByName(host);
System.out.println("IP Address :"+address);
}catch(UnknownHostException e){
System.out.println("Could not find " + host);
}
}
}


Hasil Program :



Tidak ada komentar:

Diberdayakan oleh Blogger.