将一个Student类的对象student用名称studobj存储到请求作用域中,下面代码中正确的是( )。
A: request.setAttribute( "student" ,studobj)
B: request.addAttribute("student",studobi)
C: request. setAttribute("studobj" , student)
D: request.getAttribute("studobj" , student)
A: request.setAttribute( "student" ,studobj)
B: request.addAttribute("student",studobi)
C: request. setAttribute("studobj" , student)
D: request.getAttribute("studobj" , student)
举一反三
- 声明并创建一个学生类Student的对象s,下列语法格式正确的是: A: Student s = Student(); B: Student s; C: Student s = new Student(); D: Student s = new ();
- 【单选题】定义一个学生类Student,则初始化一个学生对象的语句是( A. Student s ; B. Student s = new Student(); C. Student s = new student(); D. Student s = s.student();
- 设student是一个类名,则下列语句中,不可能正确的是 A: student a; B: student b; C: student c{3}; D: student d("LiSi");
- 假设student类定义了Name,ClassInfor,StuNumber,利用对象初始化器student类的一个对象并初始化它的属性,下面写法正确的是() A: student s1 =new student{Name=”ZhangSan”, ClassInfor =”IT201801”, StuNumber =”10000001”}; B: student s2 =new student{ ClassInfor =”IT201801”, Name=”ZhangSan”, StuNumber =”10000001”}; C: student s3 =new student{StuNumber =”10000001”}; D: 以上写法均正确
- 假设student类定义了Name,ClassInfor,StuNumber三个属性,利用对象初始化器来初始化student类的一个对象,下面写法正确的是( ) A: student s1 =new student{Name=”ZhangSan”, ClassInfor =”IT201801”, StuNumber =”10000001”}; B: student s2 =new student{ ClassInfor =”IT201801”, Name=”ZhangSan”, StuNumber =”10000001”}; C: student s3 =new student{StuNumber =”10000001”}; D: 其它三种写法均正确