多选题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 );
多选题
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 );
参考解析
解析:
暂无解析
相关考题:
Giventhatcisareferencetoavalidjava.io.Consoleobject,whichtwocodefragmentsreadalineoftextfromtheconsole?() A.Strings=c.readLine();B.char[]c=c.readLine();C.Strings=c.readConsole();D.char[]c=c.readConsole();E.Strings=c.readLine(%s,name);F.char[]c=c.readLine(%s,name);
Given:Which method will complete this class?() A.public int compareTo(Object o){/*more code here*/}B.public int compareTo(Score other){/*more code here*/}C.public int compare(Score s1,Score s2){/*more code here*/}D.public int compare(Object o1,Object o2){/*more code here*/}
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");
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?()A、 String s = “123456789”; s = (s-”123”).replace(1,3,”24”) - “89”;B、 StringBuffer s = new StringBuffer(”123456789”); s.delete(0,3).replace( 1,3, “24”).delete(4,6);C、 StringBuffer s = new StringBuffer(”123456789”); s.substring(3,6).delete( 1 ,3).insert(1, “24”);D、 StringBuilder s = new StringBuilder(”123456789”); s.substring(3,6).delete( 1 ,2).insert( 1, “24”);E、 StringBuilder s = new StringBuilder(”123456789”); s.delete(0,3).delete( 1 ,3).delete(2,5).insert( 1, “24”);
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 ");
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.
Given that file is a reference to a File object that represents a directory, which code fragments will succeed in obtaining a list of the entries in the directory?() A、Vector filelist = ((Directory) file).getList();B、String[] filelist = file.directory();C、Enumeration filelist = file.contents();D、String[] filelist = file.list();E、Vector filelist = (new Directory(file)).files();
Given that c is a reference to a valid java.io.Console object, and: 11.String pw = c.readPassword("%s", "pw: "); 12.System.out.println("got " + pw); 13.String name = c.readLine("%s", "name: "); 14.System.out.println(" got ", name); If the user types fido when prompted for a password, and then responds bob when prompted for a name,what is the result?()A、An exception is thrown at runtimeB、pw: fido got fido name: bob got bobC、pw: got fido name: bob got bobD、Compilation fails.
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 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"]; }
单选题下列选项中,正确的语句组是()。Achar s[8]; s={“Beijing”};Bchar *s; s={“Beijing”};Cchar s[8]; s=“Beijing”;Dchar *s; s=“Beijing”;
多选题1. import java.util.*; 2. public class Test { 3. public static void main(String[] args) { 4. List strings = new ArrayList(); 5. // insert code here 6. } 7. } Which four, inserted at line 5, will allow compilation to succeed?()AString s = strings.get(0);BIterator i1 = strings.iterator();CString[] array1 = strings.toArray();DIterator i2 = strings.iterator();EString[] array2 = strings.toArray(new String[1]);FIterator i3 = strings.iterator();
单选题Which signal is detected as originating from a SART?()AThe Morse code distress series S-O-S repeated 3 times followed by DE and the vessel's call signBA line of blip code on a radar screen outward from the SART's position along its line of bearingCA line of blip code on a radar screen inward from the SART's position to its own ship along its line of bearingDNone of these
单选题下列能够正确进行字符串赋值操作的是()。Achar s[5]={“ABCDE”};Bchar *s; s=“ABCDE”;Cchar s[5]={‘A’,‘B’,‘C’,‘D’,‘E’};Dchar *s; scanf(“%s”,s);
多选题Which of the following fragments might cause errors?()AString s = Gone with the wind;String t = good ;String k = s + t;BString s = Gone with the wind;String t;t = s[3] + one;CString s = Gone with the wind;String standard = s.toUpperCase();DString s = home directory;String t = s - directory;
多选题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.
多选题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?()AAdd the following line of code to the TestUserControl.ascx.cs code-behind file. public string CityName { get { return New York; } }BAdd the following line of code to the TestUserControl.ascx.cs code-behind file. protected readonly string CityName = New York;CAdd the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.CityName; }DAdd 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]; }
多选题下面哪段语法执行正确()AString s = Gone with the wind;String t = good ;String k = s + t;BString s = Gone with the wind;String t; t = s[3] + one;CString s = Gone with the wind;String standard = s.toUpperCase();DString s = home directory;String t = s - directory;
多选题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;
单选题Given that c is a reference to a valid java.io.Console object, and: 11.String pw = c.readPassword("%s", "pw: "); 12.System.out.println("got " + pw); 13.String name = c.readLine("%s", "name: "); 14.System.out.println(" got ", name); If the user types fido when prompted for a password, and then responds bob when prompted for a name,what is the result?()AAn exception is thrown at runtimeBpw: fido got fido name: bob got bobCpw: got fido name: bob got bobDCompilation fails.
多选题Which two valid declarations of a char?()AChar ch = “a”;BChar ch = ‘/’ ‘;CChar ch = ‘cafe’;DChar ch = “cafe”;EChar ch = ‘/ucafe’;FChar ch = ‘/u10100’;GChar ch = (char) true;
单选题Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()AString regex = ;BString regex = ;CString regex = .*;DString regex = //s;EString regex = //.//s*;
多选题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 );
单选题以下选项中正确的语句组是( )。Achar s[]; s=BOOK!;Bchar*s; s={BOOK!};Cchar s[10]; s=BOOK!;Dchar*s; s=BOOK!;
多选题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 );
多选题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: 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?()AObject o = pageContext.getAttribute(foo);BObject o = pageContext.findAttribute(foo);CObject o = pageContext.getAttribute(foo,PageContext.SESSION_SCOPE);DHttpSession s = pageContext.getSession();Object o = s.getAttribute(foo);