Questions about Java Socket Programming. Choose the correct answer. 1. A try/catch must enclose the calling of
Fantastic news! We've Found the answer you've been seeking!
Question:
Questions about Java Socket Programming.
Choose the correct answer.
Transcribed Image Text:
1. A try/catch must enclose the calling of the accept() method in a ServerSocket instance. a. True b. False 2. Threads can be applied to a program by either extending Thread or extending Runnable. a. True b. False 3. If a variable is declared as this, then it is guaranteed that any thread which reads the field will see the most recently written value. a. Synchronized b. Volatile c. Concurrent d. All of the above e. None of the above 4. SMTP is an example of a protocol that is data-receiving oriented. a. True b. False 5. To generate a Socket instance that will communicate to clients, the ServerSocket method to be called is accept. a. True b. False 6. Byte and character streams are unbuffered streams. a. True b. False 7. Buffered streams are usually more efficient than unbuffered streams. a. True b. False 8. Since the ports 0 to 1023 in TCP are reserved, the port 125000 can be used by any application. a. True b. False 9. This method is called to run a callable object using an Executor. a. Execute b. Start c. Submit d. All of the above e. None of the above 10. It is comprised of a collection of runnables and a group of running threads. a. Thread b. Runnable c. All of the above d. None of the above 11. Streams are used to read from and write to a socket. a. True b. False 12. A stream can represent many different kinds of sources and destinations, including a. Disk files b. Devices c. Other programs d. All of the above 13. The getAddress() method of the InetAddress class returns an array of bytes corresponding to the IP address. a. True b. False 1. A try/catch must enclose the calling of the accept() method in a ServerSocket instance. a. True b. False 2. Threads can be applied to a program by either extending Thread or extending Runnable. a. True b. False 3. If a variable is declared as this, then it is guaranteed that any thread which reads the field will see the most recently written value. a. Synchronized b. Volatile c. Concurrent d. All of the above e. None of the above 4. SMTP is an example of a protocol that is data-receiving oriented. a. True b. False 5. To generate a Socket instance that will communicate to clients, the ServerSocket method to be called is accept. a. True b. False 6. Byte and character streams are unbuffered streams. a. True b. False 7. Buffered streams are usually more efficient than unbuffered streams. a. True b. False 8. Since the ports 0 to 1023 in TCP are reserved, the port 125000 can be used by any application. a. True b. False 9. This method is called to run a callable object using an Executor. a. Execute b. Start c. Submit d. All of the above e. None of the above 10. It is comprised of a collection of runnables and a group of running threads. a. Thread b. Runnable c. All of the above d. None of the above 11. Streams are used to read from and write to a socket. a. True b. False 12. A stream can represent many different kinds of sources and destinations, including a. Disk files b. Devices c. Other programs d. All of the above 13. The getAddress() method of the InetAddress class returns an array of bytes corresponding to the IP address. a. True b. False
Expert Answer:
Answer rating: 100% (QA)
The detailed answer for the above question is provided below 1 a True Exception handling is necessary when calling the accept method as it can throw I... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Dickens, Kristen, is enrolled as a doctoral student in the Counselor Education at the University of New Orleans. She is a registered counselor intern in the state of Louisiana and works at a...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Read the case study of Statistics regarding the Lawler Grocery Store chain. The use of the sign test is demonstrated in this case study. In your opinion, what is the biggest benefit of the sign test?...
-
Vector V1 is 6.6 units long and points along the negative x axis. Vector V2 is 8.5 units long and points at to the positive x axis. (a) What are the x and y components of each vector? (b) Determine...
-
A student added 50.0 mL of an NaOH solution to 100.0 mL of 0.400 M HCl. The solution was then treated with an excess of aqueous chromium(III) nitrate, resulting in formation of 2.06 g of precipitate....
-
Your instructor will divide your class randomly into groups of four to six people. Acting as a team, with everyone offering ideas and one person serving as official recorder, each group will be...
-
The bank portion of the bank reconciliation for Helene Company at November 30, 2012, was as follows. The adjusted cash balance per bank agreed with the cash balance per books at November 30. The...
-
A string has a mass of 6.80 g, is 84.0 cm long, and has a tension of 46.0 N. If you wish to generate a wave of frequency 440.0 Hz and amplitude 0.550 mm, how much power must you supply to the string?...
-
Figure 4-34 shows an EER diagram for a restaurant, its tables, and the waiters and waiting staff managers who work at the restaurant. Your assignment is to: a. Develop a relational schema. b. Show...
-
Current events are important events happening in the world concerning people, places, things, and ideas. Watch or read the news this week to select a story that portrays leadership or a leader ...
-
It is usually true that increasing the resources devoted to prevention efforts will: Question 45Select one: a. increase quality department visibility. b. increase total cost of quality. c. decrease...
-
calculate the moving average cost from this data.... January 15 Purchase 55 17 January 16 Purchase return 5 17 January 20 Sale 91 31 January 25 Purchase 17 19
-
CAMERON & JOCELYN (married) Cameron and Jocelyn have 3 children, aged 4, 13, and 17, and also care for Jocelyn's homebound mother. They live and work in Las Vegas and take full advantage of all the...
-
What are the significant liabilities of each company? Are they current or long-term? What types of financing does each company rely on? What is the equity structure of each company?
-
XYZ Company bought rugs from the manufacturer at $50 each to be sold to the customers. The store's overhead expenses are 30% of cost, and the owners require a profit of 20% of cost. (a) For how much...
-
Six grams of liquid X at 35 degrees Celsius are added to 3 grams of liquid Y at 20 degrees Celsius. The specific heat of liquid X is 2 calories per gram per degrees Celsius, and the specific heat of...
-
Find the inverse, if it exists, for the matrix. -1
-
The shaft is fixed to the wall at A and is subjected to the torques shown. Determine the maximum shear stress in the shaft. A fillet weld having a radius of 2.75 mm is used to connect the shafts at...
-
The tapered shaft is made from 2014-T6 aluminum alloy, and has a radius which can be described by the equation r = 0.02(1 + x 3/2 ) m, where x is in meters. Determine the angle of twist of its end A...
-
Draw the shear and moment diagrams for the beam. 50 kN/m 50 kN/m A| -4.5 m -4.5 m-
-
Preventing a user who approves a configuration change from being the person who implements the change is an example of which of the following? A. Rotation of duties B. Least privilege C. Segregation...
-
A onedimensional heat conduction problem can be expressed by the following differential equation: where \(k\) is the thermal conductivity, \(T(x)\) is the temperature, and \(Q\) is heat generated per...
-
Consider a simply supported beam of length \(L\) subjected to a uniformly distributed transverse load \(p(x)=p_{0}\). Use the Rayleigh-Ritz method to determine the transverse deflection \(v(x)\) of...
Study smarter with the SolutionInn App