Java常用类库自测题目及答案.pdfVIP

  • 0
  • 0
  • 约1.94千字
  • 约 2页
  • 2026-02-06 发布于山西
  • 举报

Chapter15Common

Libraries

15.1,

Fill-in-the-Blanks

1.Inthejava.langpackage,threestringclassesareprovided:_________________,______________,and______________.Thesethreeclassesare

subclassesofthe______________interface.Themethodprovidedbythestringclasstogetthelengthofastringis______________.

2.ThemethodintheMathclassforroundingis_____________________.

3.Theobjectcloningmethodisprovidedbythe_______class,andthemethodnameis____________________________.

Theclasscontainingtheobjectmustimplementthe_____________________interface.

4.The______________,______________,______________,and______________methodsoftheStringclasscanuse

regularexpressions.

5、Throughthe______________methodintheObjectclass,youcanobtaintheClassobjectofaclass.

6、Classclassobjectscanbeinstantiatedinthreeways:______________,______________,and______________methods.。

15.2,Multiple

ChoiceQuestions

1、Usingthe_______methodoftheRuntimeclass,youcanreleasegarbagememory.

A、exec()B、run()C、invoke()D、gc()

2.WhichmethodintheObjectclasscannotbeoverridden?

A.toString()B.getClass()C.clone()D.finalize()

3.Ifyouneedtoperformcleanupoperationsforobjectfinalization,youshouldoverridethe_______methodintheObject

class.

A、toString()B、getClass()C、clone()D、finalize()

15.3,Trueor

FalseQuestions

1、AnyarrayofobjectsofanyclasscanbesortedusingtheArrays.sort()method.()

2、TheRandomclassisstoredinthejava.langpackage.()

3.AnobjectoftheRuntimeclasscanbedirectlyinstantiatedthroughitsconstructor.()

4、AnobjectoftheClassclasscanbeinstantiatedusingthenewkeyword.()

15.4,ShortAnswer

Questions

1.WhatarethedifferencesbetweentheStringclassandtheStringBufferclass?

WhatuniquemethodsdoestheStringBufferclassprovide?2.Brieflydescribethe

differencesandrolesoffinal,finally,andfinalize?3.Canthesort()methodinthe

Arraysclassachievesortingofobjectarrays?

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档