Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?()
第1题:
What two situations could require the use of multiple routing protocols? ()
第2题:
Whichtwo scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?()
第3题:
Your web application requires the adding and deleting of many session attributes during a complex usecase. A bug report has come in that indicates that an important session attribute is being deleted too soonand a NullPointerException is being thrown several interactions after the fact. You have decided to create asession event listener that will log when attributes are being deleted so you can track down when theattribute is erroneously being deleted. Which listener class will accomplish this debugging goal?()
第4题:
Which statements concerning the methods notify() and notifyAll() are true?
第5题:
Given this method in a class: public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(‟<‟); buffer.append(this.name); buffer.append(‟>‟); return buffer.toString(); } Which is true?()
第6题:
Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()
第7题:
public class MyLogger { private StringBuilder logger = new StringBuuilder(); public void log(String message, String user) { logger.append(message); logger.append(user); } } The programmer must guarantee that a single MyLogger object works properly for a multi-threaded system. How must this code be changed to be thread-safe?()
第8题:
In which situation would you use static database registration for a listener()
第9题:
This code is NOT thread-safe.
The programmer can replace StringBuffer with StringBuilder with no other changes.
This code will perform well and converting the code to use StringBuilder will not enhance the performance.
This code will perform poorly. For better performance, the code should be rewritten: return “<“+ this.name + “>”;
第10题:
When using versions of Java technology earlier than 5.0.
When sharing a StringBuffer among multiple threads.
When using the java.io class StringBufferInputStream.
When you plan to reuse the StringBuffer to build more than one string.
第11题:
Add attributes to the session object.
Add attributes on the request object.
Add parameters to the request object.
Use the pageContext object to add request attributes.
Add parameters to the JSP’s URL when generating the request dispatcher.
第12题:
the best fix is obtained by using a tangent bearing and a range
and using two radar ranges for a fix,the objects of the ranges should be close to reciprocal bearings
and using ranges,the most rapidly changing range should be measured last
and crossing a radar range of one object with the visual bearing of a second object,the two objects should be 80°to 110°apart
第13题:
When you are designing a Web application, which options define how rich text displays in a browser?()
第14题:
public class TestString3 { public static void main(String[] args) { // insert code here System.out.println(s); } } Which two code fragments, inserted independently at line 3, generate the output 4247?()
第15题:
When multiple PPP over Ethernet subscribers connect using the same DSL modem, which two attributes does the ERX use to differentiate between subscribers? ()(Choose two.)
第16题:
Which of the following is eliminated when using SATA instead of PATA technology?()
第17题:
Which methods from the String and StringBuffer classes modify the object on which they are called?()
第18题:
Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated in the servlet to the JSP for view generation.This information must NOT be accessible to any other servlet,JSP or session in the webapp. Which two techniques can you use to accomplish this goal?()
第19题:
Which object is added to a form module when you copy the reusable calender class?()
第20题:
When is an implicit anchor created?()
第21题:
synchronize the log method
replace StringBuilder with StringBuffer
No change is necessary, the current MyLogger code is already thread-safe.
replace StringBuilder with just a String object and use the string concatenation (+=) within the log method
第22题:
When using versions of Java technology earlier than 5.0.
When sharing a StringBuffer among multiple threads.
When using the java.io class StringBufferInputStream.
When you plan to reuse the StringBuffer to build more than one string.
Enitiation of separate design processes to the separation of users
第23题:
The charAt() method of the String class.
The toUpperCase() method of the String class.
The replace() method of the String class.
The reverse() method of the StringBuffer class.
The length() method of the StringBuffer class.