网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
现有: String s="write a line to a file"; w.print(s+"/n"); 哪一个是对的?()
- A、w即可以是PrintWriter类型,也可以足BufferedWriter类型。
- B、w即不可以是PrintWriter类型,也不可以足BufferedWriter类型。
- C、w可以是BufferedWriter类型,但不可以是PrintWriter类型。
- D、 w以是PrintWriter类型,但不可以是BufferedWriter类型。
参考答案
更多 “ 现有: String s="write a line to a file"; w.print(s+"/n"); 哪一个是对的?() A、w即可以是PrintWriter类型,也可以足BufferedWriter类型。B、w即不可以是PrintWriter类型,也不可以足BufferedWriter类型。C、w可以是BufferedWriter类型,但不可以是PrintWriter类型。D、 w以是PrintWriter类型,但不可以是BufferedWriter类型。” 相关考题
考题
下面的哪些程序段可能导致错误? ( ) Ⅰ: String s = "Gone with the wind"; String t = "good "; String k = s + t; Ⅱ: String s = "Gone with the wind"; String t; t = s[3] + "one"; Ⅲ: String s = "Gone with the wind"; String standard = s.toUpperCase(); Ⅳ: String s = "home directory"; String t = s-"directory":A.Ⅱ、ⅢB.Ⅱ、ⅣC.Ⅰ、ⅣD.Ⅲ、Ⅳ
考题
下列程序段运行的结果为 public class Test{ static void print(String s,int i){ System.out.println("String:"+s+",int:"+i); } static void print(int i,String s){ System.out.println("int:"+i+",String:"+s); } public static void main(String[]args){ print(99,"Int first"); } }A.String:String first,int:11B.int:11,String:Int firstC.String:String first,int99D.int:99,String:Int first
考题
request对象可以使用( )方法获取表单中某输入框提交的信息。A.getParameter(String s)B.getValue(String s)C.getParameterNames(String s)D.getParameterValue(String s)
考题
String s=”Example String”; 下面哪些语句是正确的?()
A.s>>>=3;B.int i=s.length();C.s[3]=”x”;D.String short_s=s.trim();E.String t=”root”+s;
考题
下列语句输出结果为( )。 public class test\ { public static void main (String args[]) { String s1=new String("How"); String s2=new String("How"); System.out.println(!(s1.equals(s2))); } }A.falseB.trueC.0D.1
考题
下列的哪个程序段可能导致错误? ( )A.String s="hello"; String t="good"; String k=s+t;B.String s="hello"; String t; t=s[3]+"one";C.String s="hello"; String standard=s.toUpperCase();D.String s="hello"; String t=s+"good";
考题
下列程序段: String s1=new String("How"); String s2=new String("How"); System.out.println(!(s1==s2)); 的结果为A.falseB.trueC.1D.0
考题
下列程序段运行的结果为 public class Test{ static void print(String s,int i){ System.out.println("String:"+s+",int:"+i); } static void print(int i, String s){ System.out.println("int:"+i+",String:"+s); } public static void main(String [] args){ print(99,"Int first"); } }A.String:Stringfirst,int:11B.int:11,String:Int firstC.String:String first,int:99D.int:99,String:int first
考题
下面的表达式中正确的是 ( )A.String s=“你好”;int i=3;s+=i;B.String s=“你好”;int i=3;if(i==s){s+=i};C.String s=“你好”;int i=3;s=i+s;D.String s=“你好”;int i=3; s=i+;
考题
若输入 "I am a boy!",下列程序的运行结果为______。 char connect(string1,string2,string) char string1[],string2[],string[]; { int i,j; for (i=0;stringl[i] !='\0';i++) string[i]=stringl[i]; for (j=0;string2[j] !='\0';j++) string[i+j]=string2[j]; string[i+j ] ='\0'; } main ( ) { char s1 [100] , s2 [100] , s [100]; printf ("\n 输入 string1: \n"); scanf("%s",s1); printf (" \n 输入 string2: \n" ); scanf ("%s", s2); connect (s1, s2, s); printf ("%s\n", s); }A.I am a boy!B.输入string2:C.I amD.I am a boy!
考题
语句()能正确完成赋字符串的功能。A、chars[4];s[0]=“string”B、char*s;get(s)C、char*s[]=“string”D、char*s;strcpy(s,“string”)
考题
下面的哪些程序片断可能导致错误() A、String s = "Gone with the wind"; String t = " good "; String k = s + t;B、String s = "Gone with the wind"; String t; t = s[3] + "one";C、String s = "Gone with the wind"; String standard = s.toUpperCase();D、String s = "home directory"; String t = s - "directory"
考题
现有: class Tree { private static String tree = "tree "; String getTree () { return tree; } } class Elm extends Tree { private static String tree = "elm "; public static void main (String [] args) { new Elm() .go (new Tree()) ; } } void go (Tree t) { String s = t.getTree () +Elm.tree + tree + (new Elm() .getTree ()) ; System.out.println (s) ;} 结果为:() A、 elm elm elm elmB、 tree elm elm elmC、 tree elm elm treeD、 tree elm tree elm
考题
下面哪个是对字符串String的正确定义()。A、String s1=null;B、String s2=’null’;C、String s3=(String)‘abc’;D、String s4=(String)‘/uface’;
考题
下列不是 String 类的方法的是()A、charAt(int index)B、indexOf(String s)C、beginWith(String s)D、endsWith(String s)
考题
request对象可以使用()方法获取表单中某输入框提交的信息。A、getParameter(String s)B、getValue(String s)C、getParameterNames(String s)D、getParameterValue(String s)
考题
有语句String s=”hello world”; ,以下操作哪个是不合法的()A、int i=s.length();B、s=3;C、String ts=s.trim();D、String t=s+”!”
考题
Which of the following fragments might cause errors?() A、 String s = "Gone with the wind";String t = " good ";String k = s + t;B、 String s = "Gone with the wind";String t;t = s[3] + "one";C、 String s = "Gone with the wind";String standard = s.toUpperCase();D、 String s = "home directory";String t = s - "directory";
考题
单选题现有: class Tree { private static String tree = "tree "; String getTree () { return tree; } } class Elm extends Tree { private static String tree = "elm "; public static void main (String [] args) { new Elm() .go (new Tree()) ; } } void go (Tree t) { String s = t.getTree () +Elm.tree + tree + (new Elm() .getTree ()) ; System.out.println (s) ;} 结果为:()A
elm elm elm elmB
tree elm elm elmC
tree elm elm treeD
tree elm tree elm
考题
多选题下面哪段语法执行正确()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;
考题
多选题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;
考题
多选题下面的哪些程序片断可能导致错误()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
考题
单选题下列不是 String 类的方法的是()A
charAt(int index)B
indexOf(String s)C
beginWith(String s)D
endsWith(String s)
热门标签
最新试卷