Network Applications Development I
Network Applications Development I

Network Applications Development I

Lead Author(s): Saylor Academy

Source: Saylor

Student Price: FREE

A Network Applications Development question pack by Saylor Academy.

This content is licensed under the Creative Commons Attribution 3.0 Unported License.

CC BY 3.0 - Saylor

Content on this site is licensed under a Creative Commons Attribution 3.0 Unported License .

Saylor Academy and Saylor.org® are trade names of the Constitution Foundation, a 501(c)(3) organization through which our educational activities are conducted.

Course Designer: n/a

Network Applications Development I Q1

In Java, each class can have ______________.

A

Only one subclasses

B

Only one superclass

C

State and behavior from only one other class

D

More than one subclass and superclass

Network Applications Development I Q2

What are the instances of an object called?

A

Bundle

B

Function

C

Method

D

Object

Network Applications Development I Q3

Which of the following is a characteristic of an object?

A

Behavior

B

State

C

Both A and B

D

None of the above

Network Applications Development I Q4

Which of the following is an advantage of object-oriented code?

A

Code reuse

B

Information-hiding

C

Modularity

D

All of the above

Network Applications Development I Q5

A method in Java is used to change the state in which of the following?

A

Class

B

Object

C

Program

D

All of the above

Network Applications Development I Q6

An object includes which of the following?

A

Behavior

B

Field

C

State

D

All of the above

Network Applications Development I Q7

Data encapsulation includes which of the following?

A

Internal state

B

Behavior

C

Method

D

All of the above

Network Applications Development I Q8

Which of the following is a Java package?

A

Class

B

Interface

C

Namespace

D

Relationship

Network Applications Development I Q9

Which of the following statement best describes an interface?

A

Implementing an interface formally describes the behavior it provides.

B

Methods defined by the interface do not have to appear in its source code to compile.

C

The interface does not form its “contract” between the class and the outside world until the compiled program is run.

D

All of the above

Network Applications Development I Q10

With inheritance, a class can have which of the following?

A

A commonly used state from another class

B

A rarely used behavior from a number of other classes

C

Only one subclass

D

All of the above

Network Applications Development I Q11

Which of the following statements best describes a race condition in a multi-threaded program?

A

Another thread may change or invalidate a result before the originating thread completes its sequence.

B

A race condition only exists when counting is in process.

C

The thread involves a sequence of actions, but each action is independent of a previous action.

D

All of the above

Network Applications Development I Q12

Which of the following statements best describes how networks that use blocking apply multi-threading?

A

At any given time the number of active threads may only be a fraction of the total number of threads.

B

The number of active threads should be comparable to the number of available processors.

C

Network operations may choose to block a thread that handles communication with a client.All of the above

D

All of the above

Network Applications Development I Q13

Which of the following statements best describes using a thread pool?

A

A thread pool is a large collection of threads available for tasks to be performed.

B

A new task is assigned to a thread in the pool rather than creating a new thread.

C

Thread pools are used when a small number of tasks are to be performed.

D

All of the above

Network Applications Development I Q14

Which of the following statements best describes using multi-threading?

A

A thread pool is used to make a new thread for each client connection.

B

A task that runs a significant amount of time may cause other clients to wait.

C

The server program processes connection requests from many clients.

D

All of the above

Network Applications Development I Q15

Which instance method is called inside a try..catch statement, because it can throw exceptions of type IOException?

A

Public char peek()

B

Public boolean eof()

C

Public String getln()

D

All of the above

Network Applications Development I Q16

Which Java class allows you to stream data?

A

DataInputStream

B

PrintWriter

C

Scanner

D

All of the above

Network Applications Development I Q17

Which Java stream is best used in network communications?

A

Byte

B

Character

C

Network

D

Public

Network Applications Development I Q18

Which Java stream is best when using a scanner?

A

Binary data

B

Letters in a word

C

Tokens

D

All of the above

Network Applications Development I Q19

Which of the following statements best describes the use of streaming in Java?

A

A stream is an abstraction for input/output.

B

A stream is a specific destination for output such as a network connection.

C

A stream allows the programmer to specify the source file.

D

All of the above

Network Applications Development I Q20

Which statement best describes a problem in using Java stream objects?

A

They suffer from the fragility that is often seen in character data.

B

The data in object streams is not easily available to programs written in other languages.

C

The objects can only be transmitted over a network connection from one Java program to another.

D

All of the above

Network Applications Development I Q21

Which statement best describes how to write mutable objects to an ObjectOutputStream?

A

Avoid writing the same object more than once.

B

Call the stream's reset() method before writing the object to the stream.

C

Use only string data.

D

All of the above

Network Applications Development I Q22

Which statement best describes Java stream objects?

A

They suffer from the fragility that is often seen in binary data.

B

The object streams are byte streams.

C

The objects are represented in machine-readable form for efficiency.

D

All of the above

Network Applications Development I Q23

Which statement describes why Object OutputStreams are designed to be used with an immutable stream object?

A

These streams are optimized to avoid writing the same object more than once.

B

If the object has been modified, the new data will not be written.

C

When an object is encountered for a second time, only a reference to the first occurrence is written.

D

All of the above

Network Applications Development I Q24

A Java program requires a completed form be written on the server before access is granted. Which of the following steps is required to satisfy the server?

A

Retrieve the URLConnection object.

B

Set output capability on the URLConnection.

C

Write to the output stream.

D

All of the above

Network Applications Development I Q25

Java.net classes include which of the following?

A

Client-server

B

Port

C

Socket

D

All of the above