Java Programming quiz, level Advanced, question 14
| Question: | How do you obtain the IP address of the machine your Java program is running on? |
| Answer 1: | Use the InetAddress.getLocalHost() method. This was the CORRECT answer |
| Answer 2: | Use the getHostbyNumber() method on a String object, where the string contains the word "localhost". |
| Answer 3: | Use the host.number System Property directly. |
| Answer 4: | Use the NameService.getClient() method. |
This was a question from our quiz ... but we have now provided you with
the answer (above) - we prefer to provide you with information rather than to
puzzle you.
|
|