public static void main(String[] args) { String str = “null‟; if (str == null) { System.out.println(”null”); } else (str.length() == 0) { System.out.println(”zero”); } else { System.out.println(”some”); } } What is the result?()
String[] elements = { “for”, “tea”, “too” }; String first = (elements.length > 0)? elements[0] null; What is the result?()
Given: String[] elements = { "for", "tea", "too" }; String first = (elements.length > 0) ? elements[0] : null; What is the result?()
语句Dim s(1 to 5)as String定义的数组是()类型的元素。
public static void main(String[]args){ String str="null"; if(str==null){ System.out.println("null"); }else(str.length()==0){ System.out.println("zero"); }else{ System.out.println("some"); } } What is the result?()
给定如下所示的JAVA代码,则运行时,会产生()类型的异常。 String s=null; s.concat("abc");
String[] elements={"for","tea","too"}; String first=(elements.length>0)?elements[0]null; What is the result?()
设有定义:char s[12] = string ;则printf( %d\n,strlen(s)); 的输出是( )。
若有以下定义和语句inta=4,b=3,*p,*q,*w;p=&a;q=&b;w=q;q=NULL;以下选项中错误的是
定义一个数字 String[ ] fruit s={ 苹果 , 香蕉 , 梨 , 草莓 , 橘子 , 橙子 , 菠萝 } ,数组中的 friuts[6] 指的是( ).
智慧职教: 设有以下字符串定义,则数组s1和s2( )。char s1[]={ 'S' ,'t', 'r' ,'i','n', 'g'};char s2[]= String;
下列语句正确的是:( )(多选)A.包装类的parseXxx()是静态方法B. Integer s = new Integer(“8”); 创建了一个Integer对象,表示S参数“8”指定的字符串值C.除Character类外,其他包装类可将一个字符串作为参数构造它们的实例D.当Number包装类构造方法参数为String 类型时,字符串可以为null
java中定义字符串String s=”pzhu”,下面操作可以取得字符串长度的是( )。
执行下面的代码会引发()异常。 String str = null; String strTest = new String(str);
C中,string str = null 与 string str =””,请尽量用文字说明区别。(要点:说明详细的内存
C中,string str = null 与 string str =””,请尽量用文字说明区别。(要点:说明详细的内存空间
(读写文件)下列程序完成了读取指定文件内容的功能,在下划线处应填入的代码是______。import java.io.*; public class test { public static String read (String FileName) throws Exception{ BufferedReader in = new BufferedReader(new FileReader(FileName)); String s = null; StringBuilder sb = new StringBuilder(); While((s=_____.readLine()) != null){ sb.append(s + “n”); } _______.close(); return sb.toString(); } public static void main (String [] args) throws Exception{ System.out.println(read(
给定如下所示的JAVA代码,则运行时,会产生()类型的异常 String s = null; s.concat("abc");
下面是一段javabean程序,该程序的运行结果是 () 。public class NullTest { public static void main(String[] ?args) { int M = 0; String str = null; StringBuffer sb = new StringBuffer("= "); sb.append(str); sb.ap
下列是一个类的定义,将程序段补充完整。class AString s; 【10】 int a=66;A (String s1) s=s1; static int geta () return a: )
下列哪一种约束可以定义表列中既不允许出现 NULL值,也不允许出现重复值()A.Unique约束
有定义String S = “123”;,现需将S的内容转换为数值123,可采用的方法是()。
5、以下选项中关于如下代码的说法正确的是()。 public class TestBuffered { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new FileReader("d:/wj1.txt")); BufferedWriter bw = new BufferedWriter(new FileWriter("d:/wj2.txt")); String str = br.readLine(); while(str !=null){ bw.write(str); bw.newLine(); str = br.readLine(); } br.close(); bw.close(); } }
假设有以下代码:String s="hello";String t="hello";char c[ ]={"h","e","l","l","o"}; 下列选项中,返回false的语句是______。