亚信笔试题翻译后的Word文档下载推荐.docx
《亚信笔试题翻译后的Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《亚信笔试题翻译后的Word文档下载推荐.docx(13页珍藏版)》请在冰豆网上搜索。
3、Considerthefollowingapplication:
1.classQ6{
2.publicstaticvoidmain(Stringargs[]){
3Holderh=newHolder();
4h.held=100;
5h.bump(h);
6System.out.println(h.held);
7.}
8.}
9.
10.classHoder{
11.publicintheld;
12publicvoidbump(HoldertheHolder){theHolder.held++;
13.}
Whatvalueisprintedoutatline6?
//思考如下应用,第六行的输出结果是什么?
A、0
B、1
C、100
D、101
4、Thedemonstrate(s)belongsto“hasa”relationship?
//选项中哪一项或哪些项是has-a关系?
A、publicinterfacePerson{}publicclassEmployeeextendsPerson{}
B、publicinterfaceShape{}publicinterfaceRecrandleextendsShape{}
C、publicinterfaceColorable{}publiccalssShapeimplementsColorable{}
D、publicclassSpecies{}publicclassAnimal{privateSpeciesspecies}
E、interfaceComponet{}classContainerimplementsComponent{privateComponent[]children;
5、Considerthefollowingcode:
//思考如下代码
1.for(inti=0;
i<
2;
i++){
2.for(intj=0;
j<
3;
j++){
3.if(i==j){
4.continue;
5.}
6System.out.println(“i=”+i+”j=”+j);
.
7.}
8.}
Whichlineswouldbepartoftheoutput?
答案是:
//那一行是输出的一部分
a.i=0j=0
b.i=0j=1
c.i=0j=2
d.i=1j=o
e.i=1j=1
f.i=1j=2
6、Considerthefollowingclasshierarchyandcodefragments:
//看下面的类的结构和代码块
Java.lang.Exception
\
Java.io.IOException
/\
Java.io.StreamCorruptedException.MalformedURLException
1.try{
2.URLu=newURL(s);
//assumesispreviouslydefined
3.Objecto=in.readObject();
//inisanObjectInputStream
4.System.out.println(“Success”);
6.catch(MalformedURLExceptione){
7.System.out.println(“BadURL”);
8.}
9.catch(StreamCorruptedExceptione){
10.System.out.println(“Badfilecontents”);
11.}
12.catch(Exceptione){
13.System.out.println(“Generalexception”);
14.}
15.finally{
16.System.out.println(“doingfinallypart”);
17.}
18.System.out.println(“Carryingon”);
Whatlinesareoutputifthemethodatline2throwsaMalformedURLException?
//如果在第2行抛出一个MalformedURLException将输出什么?
A、Success
B、BadURL
C、Badfilecontents
D、Generalexception
E、Doingfinallypart
F、Carryingon
7、1.publicclassTextextendsBase
2.publicTest(intj){
3.}
4.publicTest(intj,intk){
5.super(j,k);
6.}
7.}
WhichofthefollowingarelegitimatecallstoconstructinstanceofTestclass?
//下列哪些项是对test类的构造器实例的合法调用?
A、Testt=newTest();
B、Testt=newTest
(1);
C、Testt=newTest(1,2);
D、Testt=newTest(1,2,3);
E、Testt=(newBase()).newTest
(1);
8、Whichonestatementistrueaboutthecodefragmentbelow?
//在下面的代码片段中,那一种陈述是正确的
1.Strings=”abcde”;
2.StringBuffers1=newStringBuffer(“abcde”);
3.if(s.equals(s1))
4.s1=null;
5.if(s1.equals(s))
6.s=null;
A、Compilationfailsatline1,becausetheStringconstructormustbecalledexplicitly.
//在第一行编译失败,因为字符串构造器必须有明确的命名
B、Compilationfailsatline3,becausesands1havedifferenttypes.
//在第3行编译失败,因为s和s1是不同的类型
C、Compilationsucceeds.Duringexecution,anexceptionisthrownatline3.
//编译成功,在执行期间,在第三行抛出一个异常
D、Compilationsucceeds.Duringexecution,anexceptionisthrownatline5.
//编译成功,在执行期间,在第五行抛出一个异常
E、Compilationsucceeds.Noexceptionisthrownduringexecution.
//编译成功,在执行期间没有异常抛出
9、Whichwouldbemostsuitableforstoringdataelementsthatmustnotappearinthestoremorethanonce,ifsearchingisnotapriority?
//下列哪些对象最适合用于存放在结构中最多只出现一次的数据,如果查找是没有先后顺序的?
A、CollectionB、ListC、SetD、MapE、Vector
10、GiventhatThingisaclass,howmanyobjectsandreferencevariablesarecreatedbythefollowingcode?
//假如Thing是一个类,在接下来的代码中友多少对象和引用变量将被创建
Thingitem,stuff;
Item=newObject();
Thingentity=newObject();
A、Oneobjectiscreated;
B、Twoobjectsarecreated.
C、Threeobjectsarecreated.
D、Onereferencevariableiscreated.
E、Tworeferencevariablesarecreated
F、Threereferencevariablesarecreated
11.ExaminethestructureoftheEMPLOYESStable:
查看雇员表的架构:
EMPLOYEE_IDNUMBERPrimaryKey
FIRST_NAMEVARCHAR2(25)
LAST_NAMEVARCHAR2(25)
//小写
employee_idnumberprimarykey,
first_namevarchar2(25),
last_namevarchar2(25)
Whichthreestatementsinsertarowintothetable?
(choosethree)
下面那三个语句能向雇员表中插入一行?
(请选择三个正确答案)()
A.insertintoemployeesvalues(null,'
john'
'
smith'
);
B.insertintoemoloyees(first_name,last_name)values('
'
)
C.insertintoemployeesvalues('
1000'
jhon'
null);
D.insertintoemoloyees(first_name,last_name,employee_id)values(1000,'
E.insertintoemployees(employee_id)values(1000);
F.insertintoEmployees(employee_id,first_name,last_name)values(1000,'
12.EvaluatetheSQLstatement:
评定下面的SQL语句:
selectround(45.953,-1),trunc(45.936,2)fromdual;
Whichvaluesaredisplayed?
语句执行后显示的值是什么?
A.46and45
B.46and45.93
C.50and45.93
D.50and45.9
E.45and45.93
F.45.95and45.93
13.ClicktheExhibitbuttontoexaminethedataoftheEMPLOYEEStable
WhichstatementliststheID,name,andsalaryoftheemployee,andtheIDandnameoftheemployee’smanager,foralltheemployeeswhohaveamanagerandearnmorethan4000?
答案是
点击显示按钮查看雇员表的数据,在所有员工中,列举出上有部门经理且薪资大于4000职员的编号,
姓名,薪金,部门经理的编号和姓名的SQL语句是:
()
(提示:
在雇员表中,employee_id是主键,MGR_ID是经理的编号参照于employee_id)
A.selectemploee_id"
Emp_id"
emp_name"
Employee"
salary,employee_id"
Mgr_id"
Manager"
fromemployeeswheresalary>
4000;
B.selecte.emploee_id"
e.emp_name"
e.salary,m.employee_id"
m.emp_name"
fromemployeesejoinemployeesmwheree.mgr_id=m.mgr_idande.salary>
4000;
C.selecte.emploee_id"
fromemployeesejoinemployeesmon(e.mgr_id=m.employee_id)ande.salary>
D.selecte.emploee_id"
m.emp_name"
fromemployeeseselfjoinemployesemwheree.mgr_id=m.employee_idande.salary>
E.selecte.emploee_id"
fromemployeesejoinemployesemUSING(e.mgr_id=m.employee_id)ande.salary>
14.Whichtwostatementsaboutsequencesaretrue?
(choosetwo)答案是
对于序列(sequence)的叙述中,哪两个语句是正确的.(请选择两个正确选项)
A.YouuseaNEXTVALpseudocolumntolookatthenextpossiblevaluethatwouldbegeneratedfromasequence,withoutactuallyretrievingthevalue
用NEXTVAL作为虚拟列,查看序列生成的下一个的值,而不用检索整个序列
B.YouuseaCURRVALpseudocolumntolookatthecurrentvaluejustgeneratedfromasequence,withoutaffectingthefurthervaluestobegeneratedfromthesequence
用CURRVAL作为虚拟列,查看序列当前生成的值,而不会影响序列产生下一个值
C.YouuseaNEXTVALpseudocolumntoobtainthenextpossiblevaluethatwouldbegeneratedfromasequence,byactuallyretrievingthevaluefromthesequence
用NEXTVAL作为虚拟列,通过检索序列去获得序列将产生的下一个值
D.YouuseaCURRVALpseudocolumntogenerateavaluefromasequencethatwouldbeusedforaspecifieddatabasecoumn
用currval作为虚拟列,从一个将被一个指定的数据库列使用的序列来产生一个值
E、ifasequencestartingfromavalue100andincrementedby1isusedbymorethanoneapplication,thenalloftheseapplicationscouldhaveavalueof105assignedtotheircolumnwhosevalueisbeinggeneratedbythesequence
如果一个序列从100开始,并且步进为1,并被不同的应用使用,然后序列产生的105会被赋给这些应用的列
F、YouuseaREUSEclausewhencreatingasequencetorestartthesequenceonceitgeneratesthemaximumvaluedefinedforthesequence
使用reuse语句的时候,序列会从上一次产生的最大值(结果)开始产生新的序列
15.Inwhichteocaseswouldyouuseanouterjoin?
下面哪两种情况你使用外连接?
(请选择两个正确答案)()
A.ThetablesbeingjoinedhaveNOTNULLcolumns
连接的表间都没有空的列
B.Thetablesbeingjoinedhaveonlymatcheddata
连接的表间只有相匹配的数据
C.ThecolumnsbeingjoinedhaveNULLvalues
连接的列有空值
D.Thetablesbeingjoinedhaveonlyunmatcheddata
连接的表间只有不匹配的数据
E.Thetablesbeingjoinedhavebothmatchedandunmatcheddata
连接的表有相匹配的数据和不相匹配的数据
F.OnlywhenthetableshaveaprimaryKey-foreignkeyrelationship
只能在表间存在有主外键的联系
16.whichtwostatementscompleteatransaction?
(choosetwo)
下面哪两个句子完成了事物处理?
A.DELETEemployees;
B.DESCRIBEemployees;
c.ROLLBACKTOSAVAPOINTC;
D.GRANTSELECTONemployeesTOSCOTT;
E.ALTERTABLEemployeesSETUNUSEDCOLUMNsal;
F.SELECTMAX(sal)
FROMemployees
WHEREdepartment_id=20;
17.ClicktheExhibitbuttonandexamthedataintheEMPLOYEEStable.whichthreesubquerieswork?
(choosethree)
点击展示按钮并且检验EMPLOYEES表里的数据,下面哪三个子查询正确(有效)?
A.SELECT*
FROMemployees
wheresalary>
(SELECTMIN(salary)
GROUPBYdepartment_id);
BSELECT*
WHEREsalary=(SELECTAVG(salary)
CSELECTdistinctdepartment_idFROMemployeesWHEREsalary>
ANY(SELECT
AVG(salary)FROMemployeesGROUPBYdepartment_id);
DSELECTdepartment_idFROMemployeesWHEREsalary>
ALL(SELECTAVG(salary)
FROMemployeesGROUPBYdepartment_id);
ESELECTlast_nameFROMemployeesWHEREsalary>
ANY(SELECTMAX(salary)
FSELECTdepartment_id
WHEREsalary>
GROUPBYAVG(salary));
18.yourproductiondatabaseisrunningintheARCHIVELOGmodeandtheARCnprocessis
functional.youhavetwoonlineredologgroups.Whichthr