Problem in getHostAddress() method in java
but it gives me exception null
I don't understand why?
here is my code
import java.net.*; class Myserver { public static void main(String args[]) { InetAddress is=null; try { String st=is.getHostName(); System.out.println("Host address is "+st); } catch(Exception e) { System.out.println(e.getMessage());} } }