网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
多选题
Which two code fragments correctly create and initialize a static array of int elements()
A
static final int[]a={100,200};
B
static final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}
C
static final int[]a=new int[2]{100,200};
D
static final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}
参考答案
参考解析
解析:
暂无解析
更多 “多选题Which two code fragments correctly create and initialize a static array of int elements()Astatic final int[]a={100,200};Bstatic final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}Cstatic final int[]a=new int[2]{100,200};Dstatic final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}” 相关考题
考题
You create a Web application for your company‘s intranet. You want to enable users to customize their versions of the intranet home page. You create sections of content as Web Parts. You need to ensure that users can customize content at any time.Which two code segments should you use?()A.B.C.D.
考题
Which two code fragments correctly create and initialize a static array of int elements()
A.static final int[]a={100,200};B.static final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}C.static final int[]a=new int[2]{100,200};D.static final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}
考题
Given:Which three methods, inserted individually at line 14, will correctly complete class Two?()
A.int foo() { /* more code here */ }B.void foo() { /* more code here */ }C.public void foo() { /* more code here */ }D.private void foo() { /* more code here */ }E.protected void foo() { /* more code here */ }
考题
Given that: Gadget has-a Sprocket and Gadget has-a Spring and Gadget is-a Widget and Widget has-a Sprocket Which two code fragments represent these relationships? ()
A.B.C.D.E.F.
考题
Given: 3.public class MyTagHandler extends TagSupport { 4.public int doStartTag() { 5.// insert code here 6.// return an int 7.} 8.// more code here ... 18.} There is a single attribute foo in the session scope. Which three code fragments,inserted independently atline 5,return the value of the attribute?()A、Object o = pageContext.getAttribute("foo");B、Object o = pageContext.findAttribute("foo");C、Object o = pageContext.getAttribute("foo",PageContext.SESSION_SCOPE);D、HttpSession s = pageContext.getSession();Object o = s.getAttribute("foo");
考题
class One { void foo() {} } class Two extends One { //insert method here } Which three methods, inserted individually at line 14, will correctly complete class Two?()A、 int foo() { /* more code here */ }B、 void foo() { /* more code here */ }C、 public void foo() { /* more code here */ }D、 private void foo() { /* more code here */ }E、 protected void foo() { /* more code here */ }
考题
In your web application,you need to execute a block of code whenever the session object is first created. Which design will accomplish this goal?()A、Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.B、Create an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.C、Create a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.D、Create an HttpSessionListener class and implement the sessionCreated method with that block of code.
考题
Given that c is a reference to a valid java.io.Console object, which two code fragments read a line of text from the console?()A、String s = c.readLine();B、char[ ] c = c.readLine();C、String s = c.readConsole();D、char[ ] c = c.readConsole();E、String s = c.readLine("%s", "name ");F、char[ ] c = c.readLine("%s", "name ");
考题
WebSphere Commerce Accelerator will be used to create a product. The product has 6 variations determined by attributes Size, which has three values and Color, which has two values. What is the PREFERRED method to create the product and its SKUs using the Product Management tool?()A、Create the product. Create each SKU. For each SKU create two descriptive attributes with the correct values.B、Create the product. Create two defining attributes. Create each SKU and during creation assign theattributes to the SKU with the correct values.C、Create the product. Create two defining attributes with the permitted values. Generate the SKUs.D、Create the product. Create two descriptive attributes with the permitted values. Generate the SKUs.
考题
The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value?() A、char ch = 65;B、char ch = ’¥65’;C、char ch = ’¥0041’;D、char ch = ’A’;E、char ch = "A";
考题
Which code fragments will succeed in initializing a two-dimensional array named tab with a size that will cause the expression tab[3][2] to access a valid element?() CODE FRAGMENT a: int[][] tab = { { 0, 0, 0 }, { 0, 0, 0 } }; CODE FRAGMENT b: int tab[][] = new int[4][]; for (int i=0; i CODE FRAGMENT c: int tab[][] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; CODE FRAGMENT d: int tab[3][2]; CODE FRAGMENT e: int[] tab[] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0} }; A、Code fragment a.B、Code fragment b.C、Code fragment c.D、Code fragment d.E、Code fragment e.
考题
Which two code fragments will execute the method doStuff() in a separate thread?()A、new Thread() {public void run() { doStuff(); }};B、new Thread() {public void start() { doStuff(); }};C、new Thread() {public void start() { doStuff(); }}.run();D、new Thread() {public void run() { doStuff(); }}.start();E、new Thread(new Runnable() {public void run() { doStuff(); }}).start();
考题
Given that c is a reference to a valid java.io.Console object,which two code fragments read a line of textfrom the console?()A、String s = c.readLine();B、char[] c = c.readLine();C、String s = c.readConsole();D、char[] c = c.readConsole();E、String s = c.readLine("%s", "name ");
考题
You create a server control that inherits from WebControl. You need to enable the server control to emit markup for a new kind of mobile device. You must not alter the code in the server controls. Which two actions should you perform?()A、Create a class that inherits HtmlTextWriter and that can emit the new markup.B、Create a class that inherits StreamWriter and that can emit the new markup.C、Reference the class in the capabilities element of the new device's browser definition file.D、Reference the class in the controlAdapters element of the new device's browser definition file.
考题
You are developing a Windows Forms Application by using the .NET Framework 3.5.You plan to create a customized Print Preview dialog box in the application. You need to ensure that users can preview their documents before printing. Which two actions should you perform?()A、Add a PrintPreviewDialog control to the form.B、Add a PrintPreviewControl control to the form.C、Create and initialize a PrintDocument object on the form and then implement the PrintPage event handler.D、Create and initialize a PrintDocument object on the form and then implement the BeginPrint event handler.E、Set the Document property of the PrintPreviewDialog control to the PrintDocument instance that must be printed.
考题
单选题WebSphere Commerce Accelerator will be used to create a product. The product has 6 variations determined by attributes Size, which has three values and Color, which has two values. What is the PREFERRED method to create the product and its SKUs using the Product Management tool?()A
Create the product. Create each SKU. For each SKU create two descriptive attributes with the correct values.B
Create the product. Create two defining attributes. Create each SKU and during creation assign theattributes to the SKU with the correct values.C
Create the product. Create two defining attributes with the permitted values. Generate the SKUs.D
Create the product. Create two descriptive attributes with the permitted values. Generate the SKUs.
考题
多选题Given: 10. class One { 11. void foo() { } 12. } 13. class Two extends One { 14. //insert method here 15. } Which three methods, inserted individually at line 14, will correctly complete class Two?()Apublic void foo() { /* more code here */ }Bprivate void foo() { /* more code here */ }Cprotected void foo() { /* more code here */ }Dint foo() { /* more code here */ }Evoid foo() { /* more code here */ }
考题
多选题class One { void foo() {} } class Two extends One { //insert method here } Which three methods, inserted individually at line 14, will correctly complete class Two?()Aint foo() { /* more code here */ }Bvoid foo() { /* more code here */ }Cpublic void foo() { /* more code here */ }Dprivate void foo() { /* more code here */ }Eprotected void foo() { /* more code here */ }
考题
多选题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?()AString s = “123456789”; s = (s-”123”).replace(1,3,”24”) - “89”;BStringBuffer s = new StringBuffer(”123456789”); s.delete(0,3).replace( 1,3, “24”).delete(4,6);CStringBuffer s = new StringBuffer(”123456789”); s.substring(3,6).delete( 1 ,3).insert(1, “24”);DStringBuilder s = new StringBuilder(”123456789”); s.substring(3,6).delete( 1 ,2).insert( 1, “24”);EStringBuilder s = new StringBuilder(”123456789”); s.delete(0,3).delete( 1 ,3).delete(2,5).insert( 1, “24”);
考题
多选题Given: Which three methods, inserted individually at line 14, will correctly complete class Two?()Aint foo() { /* more code here */ }Bvoid foo() { /* more code here */ }Cpublic void foo() { /* more code here */ }Dprivate void foo() { /* more code here */ }Eprotected void foo() { /* more code here */ }
考题
多选题Given that c is a reference to a valid java.io.Console object, which two code fragments read a line of text from the console?()AString s = c.readLine();Bchar[ ] c = c.readLine();CString s = c.readConsole();Dchar[ ] c = c.readConsole();EString s = c.readLine(%s, name );Fchar[ ] c = c.readLine(%s, name );
考题
多选题Which two code fragments correctly create and initialize a static array of int elements?()AABBCCDD
考题
多选题Which two code fragments correctly create and initialize a static array of int elements?()Astatic final int[] a = { 100,200 };Bstatic final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }Cstatic final int[] a = new int[2]{ 100,200 };Dstatic final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }
考题
多选题The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value?()Achar ch = 65;Bchar ch = ’¥65’;Cchar ch = ’¥0041’;Dchar ch = ’A’;Echar ch = A;
考题
多选题Which two code fragments will execute the method doStuff() in a separate thread?()Anew Thread() {public void run() { doStuff(); }};Bnew Thread() {public void start() { doStuff(); }};Cnew Thread() {public void start() { doStuff(); }}.run();Dnew Thread() {public void run() { doStuff(); }}.start();Enew Thread(new Runnable() {public void run() { doStuff(); }}).start();
考题
多选题Given that c is a reference to a valid java.io.Console object,which two code fragments read a line of textfrom the console?()AString s = c.readLine();Bchar[] c = c.readLine();CString s = c.readConsole();Dchar[] c = c.readConsole();EString s = c.readLine(%s, name );
考题
多选题Which two code fragments will execute the method doStuff() in a separate thread?()Anew Thread() { public void run() { doStuff(); } }Bnew Thread() { public void start() { doStuff(); } }Cnew Thread() { public void start() { doStuff(); } } .run();Dnew Thread() { public void run() { doStuff(); } } .start();Enew Thread(new Runnable() { public void run() { doStuff(); } } ).run();Fnew Thread(new Runnable() { public void run() { doStuff(); } }).start();
考题
多选题Which two code fragments are most likely to cause a StackOverflowError?()AABBCCDDEEFF
热门标签
最新试卷