- 1、本文档共30页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
Java基础
1.Whichofthefollowingwillcompilecorrectly?
A)floatf=10f;
B)floatf=10.1;
C)floatf=10.1f;
D)byteb=10b;
2.Whichdeclarationsofidentifiersarelegal
A.$persons
B.TwoUsers
C.*point
D.this
E._endline
3.Whichstatementofassigningalongtypevariabletoahexadecimalvalueiscorrect
A.longnumber=345L;
B.longnumber=0345;
C.longnumber=0345L;
D.longnumber=0x345L
4.Whichofthefollowingfragmentsmightcauseerrors
A.Strings=Gonewiththewind;
Stringt=good;
Stringk=s+t;
B.Strings=Gonewiththewind;
Stringt;
t=s[3]+one;
C.Strings=Gonewiththewind;
Stringstandard=s.toUpperCase();
D.Strings=homedirectory;
Stringt=s-directory;
5.Whicharesyntacticallyvalidstatementat//pointx
classPerson{
privateinta;
publicintchange(intm){returnm;}
}
publicclassTeacherextendsPerson{
publicintb;
publicstaticvoidmain(Stringarg[]){
Personp=newPerson();
Teachert=newTeacher();
inti;
//pointx
}
}
A.i=m;
B.i=b;
C.i=p.a;
D.i=p.change(30);
E.i=t.b.
6.WhichlayoutmanagerisusedwhentheframeisresizedthebuttonsspositionintheFrame
mightbechanged
A.BorderLayout
B.FlowLayout
C.CardLayout
D.GridLayout
7.Giventhefollowingcodefragment:
1)publicvoidcreate(){
2}VectormyVect;
3}myVect=newVector();
4}}
Whichofthefollowingstatementsaretrue
A.Thedeclarationonline2doesnotallocatememoryspaceforthevariablemyVect.
B.Thedeclarationonline2allocatesmemoryspaceforareferencetoaVectorobject.
C.Thestatementonline2createsanobjectofclassVector.
D.Thestatementonline3createsanobjectofclassVector.
E.Thestatementonline3allocatesmemoryspaceforanobjectofclassVector
8.Whichofthefollowingansweriscorrecttoexpressthevalue8inoctalnumber
A.010
B.0x10
C.08
D.0x8
9.WhicharenotJav
文档评论(0)