Title: Test01- Requires Respondus LockDown Browser
Course: Advanced Java Programming (APT TEMPLATE) > Section: Test01

Test for Network Programming.

Q: A network is a group of computers and other devices that are connected in some fashion for the purpose of exchanging data.
- True
- False
A: True

Q: Each of the devices on the network can be thought of as a node, and each node has the same address.
- True
- False
A: False

Q: Modern networks transfer data using a concept known as packet switching.
- True
- False
A: True

Q: In order for two or more computers connected to a network to be able to exchange data in an orderly manner, each computer must use a different protocol. The protocol defines the rules by which they communicate.
- True
- False
A: False

Q: The HTTP protocol defines how web browsers and servers communicate and the SMTP protocol defines how some email is transferred
- True
- False
A: True

Q: IP is an acronym that stands for Interconnection Protocol.
- True
- False
A: False

Q: IP is a network protocol that moves packets of data from a source to a destination. As the name Internet Protocol implies, this is the protocol normally used on the Internet.
- True
- False
A: True

Q: The Transmission Control Protocol TCP was added to IP to give each end of a connection the ability to acknowledge receipt of IP packets and to request retransmission of corrupted or lost packets. Also TCP makes it possible to put the packets back together at the destination in the same order that they were sent.
- True
- False
A: True

Q: TCP and IP work together to provide a reliable method of encapsulating a message into data packets, sending the packets to a destination, and reconstructing the message from the packets at the destination.
- True
- False
A: True

Q: The User Datagram Protocol (UDP) is even more reliable than TCP/IP in guaranteeing that a series of packets will arrive in the right order. However, UDP involves a high level of overhead and the data transfer rate may be slow.
- True
- False
A: False

Q: Every computer attached to an IP network has a unique address, typically consisting of four bytes or 32 bits. Efforts are underway to expand the number of possible unique addresses to a much larger number. The planned number is the number of unique addresses that can be represented with a 128-bit address.
- True
- False
A: True

Q: For human consumption, we usually convert the value of each of the IP address bytes to an unsigned decimal value and display them connected by periods to make them easier to remember. For example, a typical IP address might be 206.77.150.222.
- True
- False
A: True

Q: Most IP addresses have a corresponding name known as a domain name.
- True
- False
A: True

Q: The Domain Name of a destination server is encapsulated into data packets and used by the internet protocol to route those packets from the source to the destination.
- True
- False
A: False

Q: The Java InetAddress class can often be used to find the domain name corresponding to an IP address, and to find the IP address corresponding to a domain name.
- True
- False
A: True

Q: Each server that you may connect to will be logically organized into ports. Theoretically, there are a large number of available ports. A subset of those port numbers are predefined to be used for certain standard services. For example, if you want to connect with a public server that communicates using the HTTP protocol, you would normally connect to port 8080 on the server of interest.
- True
- False
A: False

Q: A firewall is the common name given to the equipment and associated software that is used to improve the communication speed of computers inside of a company with the Internet at large outside the company.
- True
- False
A: False

Q: A proxy server is the common name given to the equipment and associated software that is used to insulate the network inside of a company from the Internet at large outside the company. Typically, the firewall will restrict the degree to which computers inside the company can communicate with the Internet for security and other reasons.
- True
- False
A: False

Q: URL is an acronym for Uniform Resource Locator. (It is also the name of a class in Java.) A URL is a pointer to a particular resource at a particular location on the Internet.
- True
- False
A: True

Q: True or False?

A URL specifies the following:

- the protocol used to access the server (such as http)
- the name of the server
- the port on the server (optional)
- the path and name of a specific file on the server (sometimes optional)
- the anchor or reference point within the file (optional)
- True
- False
A: True

Q: Java provides at least two different approaches for doing network programming (and possibly more), insofar as the web is concerned. The two approaches are associated with
- The Connector, DatagramConnector, and ServerConnector classes
- The URL, URLEncoder, and URLConnection classes.
- True
- False
A: False

Q: The two socket classes named Socket and DatagramSocket represent TCP and UDP communications respectively.
- True
- False
A: True

Q: Generally, the Socket and DatagramSocket classes are used to implement both clients and servers, while the ServerSocket class is only used to implement servers.
- True
- False
A: True

Q: Although the distinction between client and server is becoming less clear each day, there is one fundamental distinction that is inherent in the Java programming language.

The server initiates conversations with clients, while clients block and wait for a server to initiate a conversation.
- True
- False
A: False

Q: The Java InetAddress class can be used to find the IP address corresponding to a domain name.
- True
- False
A: True

Q: Many hosts have multiple IP addresses. To accommodate this, the InetAddress class provides a method named getByName that can be used to get an array of references to InetAddress objects representing IP addresses assigned to the host.
- True
- False
A: False

Q: The getByName method of the InetAddress class returns a reference to an InetAddress object representing the host whose domain name is passed as a parameter to the method.
- True
- False
A: True

Q: The getLocalHost method of the InetAddress class returns a reference to an array of InetAddress objects representing all of the computers on the local area network.
- True
- False
A: False

Q: There is a one-to-one correspondence between IP addresses and domain names.
- True
- False
A: False

Q: Every computer on the Internet must have a unique IP address, but multiple computers can have (or can respond to) the same domain name.
- True
- False
A: True

Q: The computer that you are using to read this test online also has an IP address and a name. The IP address, the name, and perhaps some other things as well are grouped together under something commonly referred to as localhost. In other words, the IP address of your localhost is the IP address of the computer that you are using to read this test.
- True
- False
A: True

Q: Java provides at least two different ways to do network programming. The two ways are associated with socket classes and URL classes.
- True
- False
A: True

Q: Socket programming occurs at a higher level than URL programming
- True
- False
A: False

Q: An object of the URL class provides a method for extracting each of the following parts of a URL:
- protocol used to access the server (such as http),
- name of the server,
- port on the server (optional)
- path and name of a specific file on the server (sometimes optional)
- anchor or reference within the file (optional)
- True
- False
A: True

Q: The URLEncoder class is provided to help deal with problems arising from spaces, special characters, non-alphanumeric characters, etc., that some operating systems may allow in file names but which may not be allowed in a URL.
- True
- False
A: True

Q: Once you have a URL object connected to a server, you can open input and output streams that will be connected to the server software that is monitoring the port of interest.
- True
- False
A: True

Q: The URLConnection class is an abstract class that can be extended. It has a protected constructor that takes a URL object as a parameter.
- True
- False
A: True

Q: The URLConnection class can be instantiated directly.
- True
- False
A: False

Q: A common way to get a URLConnection object is to call a method on a URL object that returns an object of a subclass of the URLConnection class.
- True
- False
A: True

Q: The method named openConnection can be called on a URL object to get a reference to an object of a class that is a subclass of the URLConnection class.
- True
- False
A: True

Q: There are three methods that can be called on a URLConnection object to obtain the following three informational aspects of the URL:
- the URL
- the date that the file was last modified
- the content type of the file
- True
- False
A: True

Q: Generally, the ServerSocket class is used to implement both clients and servers, while the Socket and DatagramSocket classes are only used to implement servers
- True
- False
A: False

Q: Socket programming provides a low-level mechanism by which you can connect two computers for the exchange of data.
- True
- False
A: True

Q: Socket programming makes it possible for you to cause data to flow in a full-duplex mode between a client and a server. This data flow can be viewed in almost exactly the same way that we view data flow to and from a disk: as a stream of bytes.
- True
- False
A: True

Q: Each of the devices on the network can be thought of as a node, and each node has a unique address.
- True
- False
A: True