Networking Package Self Test With Answers


1) Which of the following is not a Socket constructor

a) Socket ( InetAddress address, int port )
b) Socket ( String host, int port )
c) Socket(String host)                                    ( c )

2) Which of the following is not correct?

a) InetAddress encapsulates both the numerical IP address and the
    domain name for that address.
b) The InetAddress constructor takes the IP address and corresponding
    domain name
c) The InetAddress methods like getLocalHost( ), getByName( ) and
    getAllByName( ). are all static.
d) getByName( ) will return an IP address when passed a domain name

( b )

// Comment: InetAddress has no publically available constructors

3) ICANN reserves which of the following ranges of TCP/IP port numbers?

a) 1  to 1023
b) 2000 to 2999
c) 6000 to 6999
d) 1 to 65,535                 ( a )

4) Regarding ServerSocket which of the following is not an argument that
    the constructors accept?

a) int port
b) int backlog
c) InetAddress bindAddr
d) String protocol                         ( d )

5) Which of the following well known port numbers is not correct?

a) DNS        50
b) SMTP      25
c) FTP          21
d) HTTP       80                              ( a )

6) True or False. URLConnection has a constructor that can be used
    to create a URLConnection object? ( false )

7) Which of the following statements is not correct? In x-www-form-urlencoding

a) ASCII characters 'a' through 'z', 'A' through 'Z' and '0' through '9' remain the same.
b) Other characters are escaped using 3-character strings which begin with a %
c) The escaped characters are numerically represented using decimal numbers
d ) The plus sign '+' is converted into a space character ' '.                 ( c )

// Comment: Two hexadecimal numbers specify the escaped characters