下面哪个方法设置MIME类型?()A、setHeader(String headerName,String headerValue)B、setContentType(String mimeType)C、setContentLength(int length)D、addCookie(Cookie c)E、addHeader(String name,String value)

下面哪个方法设置MIME类型?()

  • A、setHeader(String headerName,String headerValue)
  • B、setContentType(String mimeType)
  • C、setContentLength(int length)
  • D、addCookie(Cookie c)
  • E、addHeader(String name,String value)

相关考题:

下列程序段运行的结果为 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

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;

给出下列的不完整的类代码,则哪个语句可以被加到横线处? ( ) class Person{ String name,department; int age; public Person(String n){name=n;} public Person(String n,int s){name=n; age=a;} public Person(String n,String d,int a){ department=d;______ } }A.Person(n,a);B.this(Person(n,a));C.this(n,s);D.this(name,age);

阅读下列程序说明和C++程序,把应填入其中(n)处的字句,写对应栏内。【说明】下面的程序实现了类String的构造函数、析构函数和赋值函数。已知类String的原型为:class String{public:String(coust char * str = NULL); //普通构造函数String( const String other); //拷贝构造函数~String(void); //析构函数String perate =(const String other); //赋值函数private:char * m_data; // 用于保存字符串};//String 的析构函数String:: ~String (void){(1);}//String 的普通构造函数String: :String( const char * str){if (2){m_data = new char[1];*m_data = '\0';}else{int length = strlen(str);m_data = new ehar[ length + 1 ];strepy(m_data, str);}}//拷贝的构造函数String:: String( const String other){ int length = strlen(other. m_data);m_data = new char[ length + 1 ];strepy(m_data, other, m_data); //赋值函数String String::operate = (eonst String other) //{if (3)return * this;delete [] m_clara; //释放原有的内存资源int length = strlen( other, m_data);m_data = new chart length + 1 ];(4);return (5);}

给出下列的不完整的类代码,则下列的( )语句可以加到横线处。 class Person{ String name,department; int age public Person(String n){name=n;} public Person(String n,int a){name=n;age=a;} pubilc Person(String n,String d,int a) { _______________ department=d; } }A.Person(n,a);B.this(Person(n,a));C.this(n,a);D.this(name,age);

下列程序段运行的结果为 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

给出下面不完整的类代码,则横线处的语句应该为( )。 class Person { String name,department; int age; public Person (Strings) {name=s;} public Person (String s,intA.{name=s;age=a;} public Person (String n,String d,intA){ __________ department=d; } }A)Person (n,A);B.this (Person(n,A));C.this(n,A);D.this(name,age);

给出下列的不完整的类代码,则下列的哪个语句可以加到横线处? class Person { String name,department; int age; public Person( String n ){ name = n;} public Person( String n,int a ) { name = n;age = a;} public Person( String n,String d,int a ) { _____________ department = d; } }A.Person(n,a);B.this(Person(n,a) );C.this(n,a);D.this(name,age);

以下( )表达式是不合法的。A.String x="Sky";int y=5;x + =y:B.String x="Sky":int y=5:if(x==y){}C.String x="Sky":int y=5:x=x+y:D.String x=null:int y=(x!=null) (x.length( )>0)?x.length:0

Person p = new Person(“张三”,23);这条语句会调用下列哪个构造方法给属性进行初始化() A.public Person(){}B.public Person(String name,int age) { this.name = name; this.age = age; }C.public Person(int age,String name) { this.age = age; this.name = name; }D.public Person(String name) { this.name = name; }

以下( )表达式是不合法的。A.string x="hello";int y=9;x+=y;B.string x="hello";int y=9;if(x=y){}C.string x="hello";int y=9;x=x+y;D.string x=null;inty=(x!=null)(x.length()>0)?x.length():0;

int index = 1;   String test = new String;   String foo = test[index];  What is the result?()A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile

下列类Account的构造方法中,声明正确的是?()    A、Account (String name)()B、Account (String  name)C、Account (name)()D、NewAccount (String name)()

下列不是 String 类的方法的是()A、charAt(int index)B、indexOf(String s)C、beginWith(String s)D、endsWith(String s)

下面哪些语句能够正确地生成5个空字符串?()A、String a[]=new String[5];for(int i=0;i5;a[i++]=“”);B、String a[]={“”,“”,“”,“”,“”};C、String a[5];D、String[5]a;E、String[]a=new String[5];for(int i=0;i5;a[i++]=null);

下面关于数组声明和初始化的语句哪个有语法错误()A、int a1[]={3,4,5};B、String a2[]={"string1","string1","string1"};C、String a3[]=new String(3);D、int[][] a4=new int[3][3];

下面哪项不是response对象的方法()A、set Content Type(String contentTypestr)B、set Header(String headername,String headervalue)C、get Parameter(String str)D、send Error(int errorcode)

在JAVA EE中,request对象的()方法可以获取页面请求中一个表单组件对应多个值时的用户的请求数据。A、String getParameter(String name)B、String[] getParameter(String name)C、String getParameterValuses(String name)D、String[] getParameterValues(String name)

有语句String s=”hello world”; ,以下操作哪个是不合法的()A、int i=s.length();B、s=3;C、String ts=s.trim();D、String t=s+”!”

Given the uncompleted code of a class:     class Person {  String name, department;     int age;  public Person(String n){  name = n; }  public Person(String n, int a){  name = n;  age = a;  }  public Person(String n, String d, int a) {  // doing the same as two arguments version of constructor     // including assignment name=n,age=a    department = d;     }     }  Which expression can be added at the "doing the same as..." part of the constructor?() A、 Person(n,a);B、 this(Person(n,a));C、 this(n,a);D、 this(name,age);

Which HttpSession method stores an object in a session?()A、 put(String name. Object value)B、 set(String name. Object value)C、 setAttribute(String name. Object value)D、 putAttribute(String name. Object value)E、 addAttribute(String name. Object value)

int index = 1;  String [] test = new String[3];  String foo = test[index];     What is the result?()  A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile

单选题int index = 1;  String [] test = new String[3];  String foo = test[index];     What is the result?()A Foo has the value “”B Foo has the value nullC An exception is thrownD The code will not compile

单选题下面哪个方法设置MIME类型?()AsetHeader(String headerName,String headerValue)BsetContentType(String mimeType)CsetContentLength(int length)DaddCookie(Cookie c)EaddHeader(String name,String value)

单选题Which HttpSession method stores an object in a session?()A put(String name. Object value)B set(String name. Object value)C setAttribute(String name. Object value)D putAttribute(String name. Object value)E addAttribute(String name. Object value)

单选题int index = 1;   String test = new String;   String foo = test[index];  What is the result?()A Foo has the value “”B Foo has the value nullC An exception is thrownD The code will not compile

单选题下面哪项不是response对象的方法()Aset Content Type(String contentTypestr)Bset Header(String headername,String headervalue)Cget Parameter(String str)Dsend Error(int errorcode)