Public void doGet(HttpServletRequest
request,Httpservletresponse response)
{
_________
}
要把session的失效时间设为30分钟,应该在下划线处插入( )
A.request.getSession().setTimeout(1800);
B.request.getSession().setTimeout(30)
C.request.getSession().setMaxInactiveInterval(1800);
D.request.getSession().setMaxInactiveInterval(30);
[单选题]有如下程序 public class Sun { public static void main(String args[ ]) { int x=1,a=0,b=0; switch(x) { case 0:b++; case 1:a++; case 2: a++; b++; } System.out.println("a="+a+","+"b="+B) } }该程序的输出结果是( )。A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=0,b=0
[单选题]( 26 )阅读下列程序片段Public void test(){Try{sayHello();system.out.println( “ hello ” );} catch (ArrayIndexOutOfBoundException e) {System.out.println( “ ArrayIndexOutOfBoundException ” );}catch(Exception e){System.out.println( “ Exception ” );}finally {Syste
[单选题]阅读下列程序片段。Public void test{Try{sayHello;system.out.println("hello"):}catch(ArraylndexOutOfBoundException e){System.out.println("ArraylndexOutOfBoundExcep—tion");}catch(Exception e){System.out.println("Exception"):}finally
[单选题]如下程序的输出结果是( )。 public class Test { void printValue(int m) { do { System.out.println("The value is"+m); } while( --m>10) } public static void main(String args[]) { int i=10; Test t=new Test(); t.printValue(i); } }A.The value is 8B.The value is 9C.Th
[单选题]如下程序的输出结果是( )。 public class Test { void printValue(int m) { do { System.out.println("The value is"+m); } while(--m > 10 ) } public static void main(String args[]) { int i=10; Test t= new Test(); t.printValue(i); } }A.The value is 8B.The value is 9C
[单选题]给出下列的程序代码片段,下列选项说法不正确的是( )。 ① public void create( ){ ② Vector my; ③ my = new Vector( ); ④ }A.第二行的声明不会为变量my分配内存空间B.第二行语句创建一个Vector类对象C.第三行语句创建一个Vector类对象D.第三行语句为一个Vector类对象分配内存空间
[单选题]有以下程序 public class Sun { public static void main(string args[ ]) { int a, b; for(a=1, b=1; a<=100; a++) { if(b>=10} break; if (b%3 1) { b+=3; continue; } } System.cut.println(A) ; } } 执行后的输出结果是( )。A.101B.6C.5D.4
[单选题]有以下程序 public class Sun { public static void main(string args[ ]) { int a, b; for(a=1, b=1; a<=100; a++) { if(b>=10) break; if (b%3==1) { b+=3; continue; } } System.out.println(A) ; } } 执行后的输出结果是( )。A.101B.6C.5D.4
[单选题]程序:classTestApp{public static void main (String[] args){int X=5:switch (x){case l:case 2:case 3:System. out.println(“一季度”);break;case 4:case 5:case 6:System. out.println(“二季度”);break;default:System. out.println(“三季度以上&rd
[单选题]给出下列的程序代码片段,下列的( )选项是不正确的。 ①public void create(){ ②Vector my; ⑧my=new Vector(); ④}A.第二行的声明不会为变量my分配内存空间B.第二行语句创建一个Vector类对象C.第三行语句创建一个Vector类对象D.第三行语句为一个Vector类对象分配内存空间