Since the method foo() does not catch the exception generated by the method baz(), it must declare the RuntimeException in its throws clause.
A try block cannot be followed by both a catch and a finally block.
An empty catch block is not allowed.
A catch block cannot follow a finally block.
A finally block must always follow one or more catch blocks.
第1题:
What will the following C code do?
int *ptr;
ptr =(int *)Ox67a9;
*ptr = Oxaa55;
第2题:
public class foo { public static void main (Stringargs) { String s; system.out.printIn (“s=” + s); } } What is the result?()
第3题:
Which statements concerning the following code are true?() class a { public a() {} public a(int i) { this(); } } class b extends a { public boolean b(String msg) { return false; } } class c extends b { private c() { super(); } public c(String msg) { this(); } public c(int i) {} }
第4题:
A developer used wsimport to generate the skeleton code for a Web service implementation. What is the purpose of the generated ObjectFactory class?()
第5题:
You are developing a Windows Communication Foundation (WCF) service that is hosted by a Windows Forms Application.The ServiceHost instance is created in the Form Constructor.You need to ensure that the service is not blocked while the UI thread is busy. What should you do?()
第6题:
You work as an application developer at Certkiller .com. You have recently created a custom collection class named ShoppingList for a local supermarket. This custom class will include ShoppinItem objects that have the public properties listed below. * Name * AisleNumber * OnDiscount You are required to enable users of your class to iterate through the ShoppingList collection, and to list each product name and aisle number using the foreach statement.You need to achieve this by declaring the appropriate code.What code should you use?()
第7题:
Move the loop code into the constructor of the service class from the OnStart method.
Drag a timer component onto the design surface of the service. Move the calls to the long-running procedure from the OnStart method into the Tick event procedure of the timer, set the Enabled property of the timer to True, and call the Start method of the timer in the OnStart method.
Add a class-level System.Timers.Timer variable to the service class code. Move the call to the DoWork method into the Elapsed event procedure of the timer, set the Enabled property of the timer to True, and call the Start method of the timer in the OnStart method.
Move the loop code from the OnStart method into the DoWork method.
第8题:
Add the following code segment to the Page_Load method of the page code-behind file. Dim custom As Custom = Me.Parent lblRegion.Text = custom.Region
Add the following code segment to the Page_Load method of the page code-behind file. Dim custom As Custom = Me.Master lblRegion.Text = custom.Region
Add the following code segment to the Page_Load method of the Custom.Master.vb code-behind file. Dim lblRegion As Label = Page.FindControl(lblRegion) lblRegion.Text = Me.Region
Add the following code segment to the Page_Load method of the Custom.Master.vb code-behind file. Dim lblRegion As Label = Master.FindControl(lblRegion) lblRegion.Text = Me.Region
第9题:
第10题:
Add code to the default constructor of the Service class to monitor the free space on the hard disk drive.
Add code to the OnStart method of the Service class to monitor the free space on the hard disk drive.
Add an instance of the System.Windows.Forms.Timer class to the Service class and configure it to fire every minute.
Add an instance of the System.Timers.Timer class to the Service class and configure it to fire every minute.
Add code to the OnStart method of the Service class to start the timer.
Add code to the Elapsed event handler of the timer to monitor the free space on the hard disk drive.
Add code to the Tick event handler of the timer to monitor the free space on the hard disk drive.
第11题:
Hello
Hello Foo
Hello world
Compilation fails.
The code does not run.
第12题:
Use the following code: AppDomain appInfo = ApplicationDomain.Current;
Use the following code: AppDomain appInfo = AppDomain.CurrentDomain ();
Use the following code: AppDomain appInfo = Thread.GetDomain ();
Use the following code: AppDomain appInfo = MainThread.GetDomain ();
第13题:
class One { public One() { System.out.print(1); } } class Two extends One { public Two() { System.out.print(2); } } class Three extends Two { public Three() { System.out.print(3); } } public class Numbers{ public static void main( String[] argv) { new Three(); } } What is the result when this code is executed?()
第14题:
public class Foo { public void main( String[] args ) { System.out.println( “Hello” + args[0] ); } } What is the result if this code is executed with the command line?()
第15题:
During system boot, rootvg fails to vary on, causing an LED code of 0552. What is the most likely cause for rootvg not varying on?()
第16题:
public class Plant { private String name; public Plant(String name) { this.name = name; } public String getName() { return name; } } public class Tree extends Plant { public void growFruit() { } public void dropLeaves() { } } Which is true?()
第17题:
You work as an application developer at Certkiller .com. Certkiller .com has instructed you to create a class named MetricFormula. This class will be used to compare MetricUnit and EnglishUnit objects.The MetricFormula is currently defined as follows (Line numbers are used for reference purposes only): 1. public class MetricFormula2. { 3. 4. } You need to ensure that the MetricFormula class can be used to compare the required objects. What should you do? ()
第18题:
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?()
第19题:
The code will fail to compile.
The constructor in a that takes an int as an argument will never be called as a result of constructing an object of class b or c.
Class c has three constructors.
Objects of class b cannot be constructed.
At most one of the constructors of each class is called as a result of constructing an object of class c.
第20题:
Since the method foo() does not catch the exception generated by the method baz(), it must declare the RuntimeException in its throws clause.
A try block cannot be followed by both a catch and a finally block.
An empty catch block is not allowed.
A catch block cannot follow a finally block.
A finally block must always follow one or more catch blocks.
第21题:
1
3
123
321
The code rims with no output.
第22题:
public class ShoppingList : ICollection {// Class implementation }
public class ShoppingList : IEnumerator, IEnumerable {// Class implementation }
public class ShoppingList : Ilist {// Class implementation }
public class ShoppingList : Enum {// Class implementation }
第23题:
Use the following code to declare the FindAttribute method: public T FindAttribute (T att) {//Find attribute and return the value }
Use the following code to declare the FindAttribute method: public object FindAttribute (object att) {//Find attribute and return the value }
Use the following code to declare the FindAttribute method: public T FindAttribute
Use the following code to declare the FindAttribute method: public string FindAttribute (string att) {//Find attribute and return the value }
第24题:
Line 5 will not compile, because void methods cannot be overridden.
Line 12 will not compile, because there is no version of test() that rakes a charargument.
The code will compile but will throw an exception at line 12.
The code will compile and produce the following output: I am an int.
The code will compile and produce the following output: I am a String.