1 2 3 4 5 6 7 8 9 10 | import java.net.InetAddress; public class test { public static void main(String[] args) throws Exception { // TODO Auto-generated method stub InetAddress adr=InetAddress.getLocalHost(); InetAddress adr2=InetAddress.getByName( "iga-1" ); String nom=adr.getHostName(); System.out.println( "@de la machine local" +adr); System.out.println( "@de la machine a" +adr2); System.out.println( "le nom de la machine" +adr+ "est:" +nom);}} |
- Saturday
- April 26th, 2025
- Ajouter un cours