Hostname: Difference between revisions
Content added Content deleted
(added J) |
|||
Line 56: | Line 56: | ||
=={{header|Java}}== |
=={{header|Java}}== |
||
<java> |
|||
import java.net.*; |
|||
class DiscoverHostName { |
|||
⚫ | |||
public static void main(String[] args) { |
|||
try { |
|||
⚫ | |||
System.out.println(hostName); |
|||
} catch (UnknownHostException e) { // Doesn't actually happen, but Java requires it be handled. |
|||
} |
|||
} |
|||
} |
|||
</java> |
|||
=={{header|OCaml}}== |
=={{header|OCaml}}== |