单选题Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done? () public class Q76a9 { static String f() { String a = "hello"; String b = "bye"; // (0) String c = b + "!"; // (1) String d = b; b = a; // (2) d = a; // (3) return c; // (4) } public static void main(String args[]) { String msg = f(); System.out.println(msg); // (5) } }AThe line marked (1).BThe line marked (2).CThe line marked (3).DThe line marked (4).EThe line marked (5).
单选题
Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done? () public class Q76a9 { static String f() { String a = "hello"; String b = "bye"; // (0) String c = b + "!"; // (1) String d = b; b = a; // (2) d = a; // (3) return c; // (4) } public static void main(String args[]) { String msg = f(); System.out.println(msg); // (5) } }
A
The line marked (1).
B
The line marked (2).
C
The line marked (3).
D
The line marked (4).
E
The line marked (5).
参考解析
解析:
暂无解析
相关考题:
11.public void genNumbers(){12.ArrayList numbers=new ArrayList();13.for(inti=0;i14.intvalue=i*((int)Math.random());15.IntegerintObj=newInteger(value);16.numbers.add(intObj);17.}18.System.out.println(numbers);19.}Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbagec ollection?()A.Line16B.Line17C.Line18D.Line19E.The object is NOT a candidate for garbage collection.
Given:Under which three circumstances will the code on line 37 be executed?() A.The instance gets garbage collected.B.The code on line 33 throws an exception.C.The code on line 35 throws an exception.D.The code on line 31 throws an exception.E.The code on line 33 executes successfully.
Click the Exhibit button. Given:Which two statements are true if a NullPointerException is thrown on line 3 of class C? () A.The application will crash.B.The code on line 29 will be executed.C.The code on line 5 of class A will execute.D.The code on line 5 of class B will execute.E.The exception will be propagated back to line 27.
Given:Which code, inserted at line 16, correctly retrieves a local instance of a Point object?() A.Point p = Line.getPoint();B.Line.Point p = Line.getPoint();C.Point p = (new Line()).getPoint();D.Line.Point p = (new Line()).getPoint();
Which of the following can be used to insert a new line below the current line inside a vi session?() A. oB. aC. pD. A
According to the passage,which of the following was the earliest kind of exchange of wealth A.Bartered foodsB.Fiat moneyC.Coin currencyD.Intangible forms
11.public void genNumbers(){ 12.ArrayList numbers=new ArrayList(); 13.for(inti=0;i10;i++){ 14.intvalue=i*((int)Math.random()); 15.IntegerintObj=newInteger(value); 16.numbers.add(intObj); 17.} 18.System.out.println(numbers); 19.} Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbagec ollection?()A、Line16B、Line17C、Line18D、Line19E、The object is NOT a candidate for garbage collection.
helga is working with a multi-value field that has numeric values in a list. she would like to apply a formula to each item in the list, return the list which one of the following @fuctions can she use to accomplish this with one line of code?()A、@transform B、@Listprocess C、@processlist D、@listevaluate
31. // some code here 32. try { 33. // some code here 34. } catch (SomeException se) { 35. // some code here 36. } finally { 37. // some code here 38. } Under which three circumstances will the code on line 37 be executed?()A、 The instance gets garbage collected.B、 The code on line 33 throws an exception.C、 The code on line 35 throws an exception.D、 The code on line 31 throws an exception.E、 The code on line 33 executes successfully.
Which of the following is a secure method of remote access via command line?()A、RCPB、TelnetC、RSHD、SSH
After plugging in and installing drivers for a wireless bar code reader, which of the following is the LAST step needed to configure the device?()A、Install an inventory tracking application.B、Scan the bar code on the reader’s cradle.C、Enable the device in Device Manager.D、Remove any temporary device drivers.
Which of the following can be used to insert a new line below the current line inside a vi session?()A、oB、aC、pD、A
Given the following code: 1) public void modify() { 2) int i, j, k; 3) i = 100; 4) while ( i 0 ) { 5) j = i * 2; 6) System.out.println (" The value of j is " + j ); 7) k = k + 1; 8) i--; 9) } 10) } Which line might cause an error during compilation?() A、 line 4B、 line 6C、 line 7D、 line 8
Given the following code fragment: public void create() { Vector myVect; myVect = new Vector(); } Which of the following statements are true?() A、 The declaration on line 2 does not allocate memory space for the variable myVect.B、 The declaration on line 2 allocates memory space for a reference to a Vector object.C、 The statement on line 2 creates an object of class Vector.D、 The statement on line 3 creates an object of class Vector.E、 The statement on line 3 allocates memory space for an object of class Vector.
Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done? () public class Q76a9 { static String f() { String a = "hello"; String b = "bye"; // (0) String c = b + "!"; // (1) String d = b; b = a; // (2) d = a; // (3) return c; // (4) } public static void main(String args[]) { String msg = f(); System.out.println(msg); // (5) } } A、The line marked (1).B、The line marked (2).C、The line marked (3).D、The line marked (4).E、The line marked (5).
You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code. On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New York". You also must add code to TestPage.aspx to read this value. Which two actions should you perform?()A、Add the following line of code to the TestUserControl.ascx.cs code-behind file. public string CityName { get { return "New York"; } } B、Add the following line of code to the TestUserControl.ascx.cs code-behind file. protected readonly string CityName = "New York"; C、Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.CityName; } D、Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.Attributes["CityName"]; }
You are working with a Windows Communication Foundation (WCF) client application that has a generated proxy named SampleServiceProxy.When the client application is executing, in line 04 of the following code, the channel faults (Line numbers are included for reference only.) 01 SampleServiceProxy proxy = new SampleServiceProxy( ); 02 try 03 { 04 proxy.ProcessInvoice(invoice); 05 } 06 catch 07 { 08 if(proxy.State == CommunicationState.Faulted) 09 { 10 ... 11 } 12 } 13 proxy.UpdateCustomer(customer);You need to return proxy to a state in which it can successfully execute the call in line 13.Which code segment should you use at line 10?()A、proxy.Close();B、proxy = new SampleServiceProxy();C、proxy.Abort();D、proxy.Open();
You are developing a Windows Communication Foundation (WCF) service to replace an existing ASMX Web service.The WCF service contains the following code segment. (Line numbers are included for reference only.) 01 [ServiceContract( )] 02 03 public interface IEmployeeService 04 { 05 [OperationContract( )] 06 EmployeeInfo GetEmployeeInfo(int employeeID); 07 08 } 09 10 public class EmployeeService : IEmployeeService 11 { 12 13 public EmployeeInfo GetEmployeeInfo(int employeeID) 14 { 15 ... 16 } 17 } 18 19 20 public class EmployeeInfo 21 { 22 ... 23 public int EmployeeID { get; set; } 24 public string FirstName { get; set; } 25 public string LastName { get; set; } 26 27 }The existing Web service returns the EmployeelD as an attribute of the Employeelnfo element in the response XML.You need to ensure that applications can consume the service without code changes in the client. What should you do?()A、Insert the following code at line 02. [DataContractFormat()] Insert the following code at line 22. [DataMember()]B、Insert the following code at line 02. [XmlSerializerFormat()] Insert the following code at line 22. [XmlAtttibute()]C、Insert the following code at line 09. [XmlSerializerFormat()] Insert the following code at line 22. [XmlAttribute()]D、Insert the following code at line 19. [DataContractFormat()] Insert the following code at line 22. [DataMember()]
多选题Click the Exhibit button. Given: Which two statements are true if a NullPointerException is thrown on line 3 of class C?()AThe application will crash.BThe code on line 29 will be executed.CThe code on line 5 of class A will execute.DThe exception will be propagated back to line 27.EThe code on line 5 of class B will execute.
多选题31. // some code here 32. try { 33. // some code here 34. } catch (SomeException se) { 35. // some code here 36. } finally { 37. // some code here 38. } Under which three circumstances will the code on line 37 be executed?()AThe instance gets garbage collected.BThe code on line 33 throws an exception.CThe code on line 35 throws an exception.DThe code on line 31 throws an exception.EThe code on line 33 executes successfully.
单选题Which of the following can be used to insert a new line below the current line inside a vi session?()AoBaCpDA
单选题Given: Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?()A Line 16B Line 17C Line 18D Line 19
多选题You develop a Windows Communication Foundation (WCF) service that employees use to access bonus information.You define the following service contract. (Line numbers are included for reference only.) 01 [ServiceContract(SessionMode = SessionMode.Required)] 02 public interface IFinancialService 03 { 04 [OperationContract] 05 string Login(int employeeID, string passwordHash); 06 07 [OperationContract] 08 double GetBonus(int month); 09 10 [OperationContract(IsTerminating = true)] 11 void Logout( ); 12 } Client application can invoke methods without logging in. You need to ensure that the client applications invoke Login before invoking any other method. You also need to ensure that client applications cannot consume the service after invoking Logout. Which two action should you perform? ()(Each correct answer presents part of the solution. Choose two.)。AReplace line 04 with the following code. [OperationContract(IsInitiating = false)]BReplace line 04 with the following code. [OperationContract(IsInitiating = true, IsTerminating = true)]CReplace line 07 with the following code. [OperationContract(IsInitiating = false)]DReplace line 10 with the following code. [OperationContract(IsInitiating = false, IsTerminating = true)]
多选题Given the following code fragment: public void create() { Vector myVect; myVect = new Vector(); } Which of the following statements are true?()AThe declaration on line 2 does not allocate memory space for the variable myVect.BThe declaration on line 2 allocates memory space for a reference to a Vector object.CThe statement on line 2 creates an object of class Vector.DThe statement on line 3 creates an object of class Vector.EThe statement on line 3 allocates memory space for an object of class Vector.
单选题Which of the following command line utilities allows a technician to create a new directory?()ARDBCDCDIRDMD
单选题Consider the following class: class Test(int i) { void test(int i) { System.out.println(“I am an int.”); } void test(String s) { System.out.println(“I am a string.”); } public static void main(String args) { Test t=new Test(); char ch=“y”; t.test(ch); } } Which of the statements below is true?()A Line 5 will not compile, because void methods cannot be overridden.B Line 12 will not compile, because there is no version of test() that rakes a charargument.C The code will compile but will throw an exception at line 12.D The code will compile and produce the following output: I am an int.E The code will compile and produce the following output: I am a String.