多选题You are building a dating web site. The client’s date of birth is collected along with lots of other information.The Person class has a derived method, getAge():int, which returns the person’s age calculated from thedate of birth and today’s date. In o

题目
多选题
You are building a dating web site. The client’s date of birth is collected along with lots of other information.The Person class has a derived method, getAge():int, which returns the person’s age calculated from thedate of birth and today’s date. In one of your JSPs you need to print a special message to clients within theage group of 25 through 35. Which two EL code snippets will return true for this condition? ()
A

${client.age in [25,35]}

B

${client.age between [25,35]}

C

${client.age between 25 and 35}

D

${client.age <= 35 && client.age >= 25}

E

${client.age le 35 and client.age ge 25}

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

已知学生记录描述为:

struct student

{ int no;

char name[20],sex;

struct

{ int year,month,day;

} birth;

};

struct student s;

设变量s中的"生日"是"1984年11月12日",对"birth"正确赋值的程序段是

A.year=1984;month=11;day=12;

B.s.year=1984;s.month=11;s.day=12;

C.birth.year=1984;birth.month=11;birth.day=12;

D.s.birth.year=1984;s.birth.month=11;s.birth.day=12;


正确答案:D

第2题:

Given:Which method will complete this class?()

A.public int compareTo(Object o){/*more code here*/}

B.public int compareTo(Score other){/*more code here*/}

C.public int compare(Score s1,Score s2){/*more code here*/}

D.public int compare(Object o1,Object o2){/*more code here*/}


参考答案:B

第3题:

已知学生记录描述为 struct student { int no; char name[20]; char sex; struct { int year; int month; int day; } birth; }; struct student s;变量s中的“生日”应是“1985年4月4日”,下列对“生日”的正确赋值方式是______。

A.year=1985;month=4;day=4;

B.birth.year=1985;birth.month=4;birth.day=4;

C.s.year=1985;s.month=4;s.day=4;

D.s.birth.year=1985;s.birth.month=4;s.birth,day=4;


正确答案:D

第4题:

what’s your date of birth?


正确答案:My date of birth is May 18th, 1990.

第5题:

下列程序中需要清理动态分配的数组,划线处应有的语句是_______。 include class pers

下列程序中需要清理动态分配的数组,划线处应有的语句是_______。

include<iostream.h>

class person

{

int age,tall;

public:

person( ){age=0;tall=40;cout<<"A baby is born."<<endl;}

person(int i){age=i;tall=40;cout<<"A old person."<<endl;}

person(int i,int j){age=i;tall=j;cout<<"a old person with tall."<<endl;)

~person( ){cout<<"person dead."<<endl;}

void show( )

{

cout<<"age="<<age<<",tall="<<tall<<endl;

}

};

void main( )

{

person*ptr;

ptr=new person[3];

ptr[0]=person( );

ptr[1]=person(18);

ptr[2]=person(20,120);

for(int i=0;i<3;i++)

ptr[i].show( );

______

}


正确答案:delete[]ptr;
delete[]ptr; 解析:本题考察对象数组的销毁方法,注意删除对象数组时,[]内不要指定大小。

第6题:

给出下列的不完整的类代码,则哪个语句可以被加到横线处? ( ) 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

第7题:

根据下面的程序,可以在主程序中使用的合法语句是( )。 include using namesp

根据下面的程序,可以在主程序中使用的合法语句是( )。 #include <iostream> using namespace std; class Person{ int age; public: void SetAge(int x){age=x;} void ShowAge(){cout<<"the Person's age is" <<age;} }; class Student:private Person{ public:int study_code; }; void main(){ Student wangqiang; wangqiang.study_code=23; }

A.wangqiang.age=231

B.wangqiang.Setage(23)

C.wangqiang.ShowAge()

D.wangqiang.study_code=12


正确答案:D
解析:由于是私有继承,基类中所有成员成为派生类中的私有成员,故不能由派生类的对象访问,只有派生类的公有成员可由派生类对象访问。

第8题:

设有下列两个类的定义,则类Person和类Man的关系是( )。 class Person { long id; //身份证号 String name; //姓名 } class Man extends Person { int age; //年龄 int getAge() { return age; } }

A.包含关系

B.继承关系

C.关联关系

D.无关系,上述类定义有语法错误


正确答案:B
解析:本题主要考查Java中类的继承,通过在类声明中加入extends子句来创建子类,其格式为:class SubClass sextends SuperClass{},其中SubClass为子类名,SuperClass为父类名。

第9题:

给出下面不完整的类代码,则横线处的语句应该为( )。 class Person { String name,department; int age; public Person (Strings) {name=s;} public Person (String s,int

A.{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);


正确答案:C
解析:本题主要考查在同一个类的不同构造方法中调用该类的其他构造方法需要使用 this(…)的形式,而且必须是在构造方法的第一行调用。这个和普通方法重载调用的方式不同,普通方法可以直接使用方法名加参数来调用,而且调用位置没有限制,因此选项A是不行的,选项B的语法就是错误的,选项D的错误在于在父类型的构造方法被调用前不能引用类的成员。构造方法是一个类对象实例化的开始,因此在构造方法中不能将成员作为参数引用。

第10题:

根据下面的程序,可以在主程序中使用的合法语句是( )。 include using namespa

根据下面的程序,可以在主程序中使用的合法语句是( )。 #include <iostream> using namespace std; class Person{ int age; voidtest(){} public: Person(intage){this->age=age;} void ShowAge(){cout<<"the Person's age is",<<age;} }; void main(){ Person wang(23); }

A.wang.age=45

B.wang.wang(45)

C.wang.ShowAge()

D.wang.test()


正确答案:C
解析:ShowAse是类的公有成员,可以由对象访问,其他的为私有成员,类对象不能访问。

更多相关问题