单选题Given a method that must ensure that its parameter is not null: 11. public void someMethod(Object value) { 12. // check for null value ... 20. System.out.println(value.getClass()); 21. } What inserted at line 12, is the appropriate way to handle a null value?()Aassert value == null;Bassert value != null, value is null;Cif (value == null) { throw new AssertionException(value is null); }Dif (value == null) { throw new IllegalArgumentException(value is null); }

单选题
Given a method that must ensure that its parameter is not null: 11. public void someMethod(Object value) { 12. // check for null value ... 20. System.out.println(value.getClass()); 21. } What inserted at line 12, is the appropriate way to handle a null value?()
A

assert value == null;

B

assert value != null, value is null;

C

if (value == null) { throw new AssertionException(value is null); }

D

if (value == null) { throw new IllegalArgumentException(value is null); }


参考解析

解析: 暂无解析

相关考题:

You are writing a method that accepts a string parameter named message.Your method must break the message parameter into individual lines of text and pass each line to a second method named Process.Which code segment should you use?()A.B.C.D.

Click the Exhibit button. Given:Which statement is true if a TestException is thrown on line 3 of class B? () A.Line 33 must be called within a try block.B.The exception thrown by method1 in class A is not required to be caught.C.The method declared on line 31 must be declared to throw a RuntimeException.D.On line 5 of class A, the call to method2 of class B does not need to be placed in a try/catch block.

You are configuring the ERX Edge Router as an LNS in an L2TP network.Which statement is true about the value of the remote host parameter?() A.It must be the same as the server-name parameter on the LACB.It must be the same as the client-name arameteron the LACC.It must be the same as the remote-hostname parameter on the LACD.It must be the same as the tunnel password parameter on the LAC

Which two statements are true about the hashCode method?()A、 The hashCode method for a given class can be used to test for object equality and object inequality for that class.B、 The hashCode method is used by the java.util.SortedSet collection class to order theelements within that set.C、 The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.D、 The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.E、 The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.

What is the name of the method that threads can use to pause their execution until signalled to continue by another thread? () Fill in the name of the method (do not include a parameter list).

Given the Tag:   Assuming the tag referenced by my Tags: get Advice uses the Classic event model,  which is true?()A、 The do After Body method is called.B、 The doEnd Tag method is NOT called.C、 The type attribute may be specified in the TLDD、 The do Start Tag Method must always return SKIP_BODY.E、 The TLD for this tag must NOT include a  tag.

Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains: foo frodo Which two are true?()A、The foo initialization parameter CANNOT be set programmatically.B、Compilation fails because getInitParameter returns type Object.C、The foo initialization parameter is NOT a servlet initialization parameter.D、Compilation fails because ServletContext does NOT have a getInitParameter method.E、The foo parameter must be defined within the  element of the deployment descriptor.

You are configuring the ERX Edge Router as an LNS in an L2TP network.Which statement is true about the value of the remote host parameter?()A、It must be the same as the server-name parameter on the LACB、It must be the same as the client-name arameteron the LACC、It must be the same as the remote-hostname parameter on the LACD、It must be the same as the tunnel password parameter on the LAC

A batch application executes a large number of update statements. The service level agreement for the application states that the application must complete its work as quickly as possible to ensure that dependent workloads can start ontime. What is one way to help the application complete quickly?()A、Code the application to issue a LOCK TABLE statement.  B、Code the application to issue a LOCK ROW statement.  C、Decrease the number of I/O servers.  D、Increase the locklist parameter.

Given an EL function declared with:11.  12.spin 13.com.example.Spinner 14. 15.java.lang.String spinIt() 16. 17. Which two are true?()A、The function method must have the signature: public String spin().B、The method must be mapped to the logical name "spin" in the web.xml file.C、The function method must have the signature: public String spinIt().D、The function method must have the signature public static String spin().E、The function method must have the signature: public static String spinIt().F、The function class must be named Spinner, and must be in the package com.example.

Which three statements describe the functionality of the DO_KEY built-in?()A、It accepts both a built-in and a key name as argument. B、If no key trigger is defined, the specified built-in executes. C、Its parameter must be specified in upper case, enclosed in single quotation marks. D、It performs the same task as if you pressed the function key associated with the specified argument. E、It executes the key trigger that corresponds to the built-in specified as its parameter.

Your database block size is 4 KB. In this database, you are required to create a tablespace with a block size of 8 KB. Which is the prerequisite for creating this tablespace?()A、 The parameter DB_CACHE_SIZE must be a multiple of 8.B、 The value of the parameter SGA_MAX_SIZE must be increased.C、 The tablespace must be created with a uniform extent size of 8 KBD、 The parameter DB_8K_CACHE_SIZE must be defined in the parameter file.

You are developing a custom-collection class.You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?()A、The method must return a type of either IEnumerator or IEnumerable.B、The method must return a type of IComparable.C、The method must explicitly contain a collection.D、The method must be the only iterator in the class.

You are creating an assembly named Assembly1.Assembly1 contains a public method. The global cache contains a second assembly named Assembly2.You must ensure that the public method is only called from Assembly2.Which permission class should you use?()A、GacIdentity PermissionB、Publisher Identity PermissionC、Data Protection PermissionD、Strong Name Identity Permission

单选题You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application uses the LINQ ParallelEnumerable. AsParallel method to perform multiple queries on a database. You need to ensure that queries can execute on separate threads concurrently. What should you do? ()AUse the AsOrdered method.BUse the SelectMany method.CUse the AutoBuffered option in the WithMergeOptions method.DUse the WithExecutionMode method with the ParallelExecutionMode.ForceParallelism parameter.

单选题Your database block size is 4 KB. In this database, you are required to create a tablespace with a block size of 8 KB. Which is the prerequisite for creating this tablespace?()A The parameter DB_CACHE_SIZE must be a multiple of 8.B The value of the parameter SGA_MAX_SIZE must be increased.C The tablespace must be created with a uniform extent size of 8 KBD The parameter DB_8K_CACHE_SIZE must be defined in the parameter file.

多选题You are defining a class named MyClass that contains several child objects. MyClass contains a method named ProcessChildren that performs actions on the child objects.MyClass objects will be serializable.You need to ensure that the ProcessChildren method is executed after the MyClass object and all its child objects are reconstructed. Which two actions should you perform?()AApply the OnDeserializing attribute to the ProcessChildren method.BSpecify that MyClass implements the IDeserializationCallback interface.CSpecify that MyClass inherits from the ObjectManager class.DApply the OnSerialized attribute to the ProcessChildren method.ECreate a GetObjectData method that calls ProcessChildren.FCreate an OnDeserialization method that calls ProcessChildren.

单选题Given the Tag:   Assuming the tag referenced by my Tags: get Advice uses the Classic event model,  which is true?()A The do After Body method is called.B The doEnd Tag method is NOT called.C The type attribute may be specified in the TLDD The do Start Tag Method must always return SKIP_BODY.E The TLD for this tag must NOT include a  tag.

多选题You want to create a filter for your web application and your filter will implement javax.servlet.Filter. Which two statements are true?()AYour filter class must implement an init method and a destroy method.BYour filter class must also implement javax.servlet.FilterChain.CWhen your filter chains to the next filter, it should pass the same arguments it received in its doFiltermethod.DThe method that your filter invokes on the object it received that implements javax.servlet.FilterChaincan invoke either another filter or a servlet.EYour filter class must implement a doFilter method that takes, among other things, anHTTPServletRequest object and an HTTPServletResponse object.

多选题You are developing a Windows Communication Foundation (WCF) service that returns location information for authorized law enforcement agencies. The service contract is as follows: [ServiceContract] public interface IMappingService { [OperationContract] long[] GetLocationCoordinates(String cityName); [OperationContract] long[] GetLocationOfCitizen(String ssn); } Users are authenticated and impersonated. The system uses ASP.NET roles. The members of law enforcement are members of the LawEnforcement role. You need to ensure that only members of the LawEnforcement role can call these methods. What are two possible ways to achieve this goal?() (Each correct answer presents a complete solution. Choose two.)AAdd a PrincipalPermissionAttribute to each method that should be available only to members of law enforcement. Set its SecurityAction to Demand and set the role equal to LawEnforcement.BUse the CurrentPrincipal property of the thread. Call the IsInRole method specifying LawEnforcement as a parameter.CCreate a GenericPrincipal specifying Thread.CurrentPrincipal.Identity as the IIdentityParameter and LawEnforcement as the only value for the Roles parameter.DAt the beginning of each method, enumerate each ClaimSet in a new WindowsClaimSet. Use the FindClaims method to locate a claim type named Role with a right named LawEnforcement.

单选题During an engine room watch if immediate action is necessary to ensure safety of the ship its machinery and crew ()Athe chief engineer must be informed at firstBthe captain must be informed at firstCit must be taken by the duty engineerDthe generator engine must be stopped

单选题Given a method that must ensure that its parameter is not null: 11. public void someMethod(Object value) { 12. // check for null value ... 20. System.out.println(value.getClass()); 21. } What inserted at line 12, is the appropriate way to handle a null value?()Aassert value == null;Bassert value != null, value is null;Cif (value == null) { throw new AssertionException(value is null); }Dif (value == null) { throw new IllegalArgumentException(value is null); }

单选题Given a bridge link 6 miles (9.7 km) long,which parameter on the Root Radio Interface page must be configured in order for IP traffic to pass?()ARTSBdistance(kilometers)CconcatenationDCCA

多选题Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains: foo frodo Which two are true?()AThe foo initialization parameter CANNOT be set programmatically.BCompilation fails because getInitParameter returns type Object.CThe foo initialization parameter is NOT a servlet initialization parameter.DCompilation fails because ServletContext does NOT have a getInitParameter method.EThe foo parameter must be defined within the  element of the deployment descriptor.

单选题However, where immediate action is necessary to ensure safety of the ship, its machinery and crew, it must be taken by the engineer in chargeWhat dose “it” mean in the sentence above?()AsafetyBthe ship, its machinery and crewCimmediate actionDthe engineer in charge

单选题You are developing a custom-collection class.You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?()AThe method must return a type of either IEnumerator or IEnumerable.BThe method must return a type of IComparable.CThe method must explicitly contain a collection.DThe method must be the only iterator in the class.

多选题Which two statements are true about the hashCode method?()AThe hashCode method for a given class can be used to test for object equality and object inequality for that class.BThe hashCode method is used by the java.util.SortedSet collection class to order theelements within that set.CThe hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.DThe only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.EThe hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.

多选题Given an EL function declared with:11.  12.spin 13.com.example.Spinner 14. 15.java.lang.String spinIt() 16. 17. Which two are true?()AThe function method must have the signature: public String spin().BThe method must be mapped to the logical name spin in the web.xml file.CThe function method must have the signature: public String spinIt().DThe function method must have the signature public static String spin().EThe function method must have the signature: public static String spinIt().FThe function class must be named Spinner, and must be in the package com.example.