举一反三
- ResultSet的方法getDouble(int index)、getString(int index)和getInt(int index)获取index列的值,index的值是从1开始。( )
- 阅读下面一段程序: words = "Hello,Python" index = words.index("Py", 0,6) print(index) 运行程序,最终执行的结果为()
- score是一个整数数组,有五个元素,已经正确初始化并赋值,仔细阅读下面代码,程序运行结果是() temp = score[0]; for (int index = 1;index < 5;index++) { if (score[index] < temp) { temp = score[index]; } }
- 下面类的索引定义或使用正确的是()。 A: class MyClass{ int x; int y; public int this[int index] { get{ if (index==0) return x; else return y; }}} B: class MyClass{ int x; int y; public int this[int index] { set{ if (index==0) x=value; else y=value; }}} C: class MyClass{ int x; int y; public int INDEX[int index] { get{ if (index==0) return x; else return y; } set{ if (index==0) x=value; else y=value; }}} D: class MyClass{ int x; int y; public int this[int index] { get{ if (index==0) return x; else return y; } set{ if (index==0) x=value; else y=value; }}}
- 当输入为 ‘cbabc’ 时,下列程序的输出结果为?s1 = raw_input() index = 0 s2 = '' while index [ len(s1) - 1: if s1[index] ] s1[index + 1]: s2 += s1[index] else: s2 = s2 * 2 index += 1 print s2
内容
- 0
下面不属于List接口方法的是 A: void add(int index,Object element) B: Object set(int index,Object element) C: Object get(int index) D: Vector(int size)
- 1
写出下面程序的输出结果 publicclassTestjava{ publicstaticvoidmain(String[]args){ Stringstr="abbaefabbewbvwabbswgfga"; System.out.println("count="+getSubCount(str,"abb")); } publicstaticintgetSubCount(Stringstr,Stringkey){ intcount=0; intindex=0; while((index=str.indexOf(key,index))!=-1){ System.out.println("index="+index); index=index+key.length(); count++; } returncount; } }
- 2
Given: int index = 1; boolean[] test = new Boolean; boolean foo= test [index]; What is the result?
- 3
下面哪个方法用于从ServletContent中检索属性值?() A: String getAttribute(int index ) B: String getObject(int index ) C: Object getAttribute(int index ) D: Object getObject(int index ) E: Object getAttribute(String name ) F: String getAttribute(String name )
- 4
17e0be3e9ddcbf4.png如图所示,将姓名列这一组姓名纵向循环显示在一列中的计算公式,正确的是()。 A: =INDEX($A$2:$A$11,MOD(ROW(A10),10)+1) B: =INDEX($A$2:$A$11,INT(ROW(A10)/10)) C: =INDEX($A$2:$A$11,MOD(ROW(A10),10)+1,1) D: =INDEX($A$2:$A$11,INT(ROW(A10)/10),1)