Java英文面试题经典Word格式.docx

上传人:b****2 文档编号:14259248 上传时间:2022-10-21 格式:DOCX 页数:20 大小:53.39KB
下载 相关 举报
Java英文面试题经典Word格式.docx_第1页
第1页 / 共20页
Java英文面试题经典Word格式.docx_第2页
第2页 / 共20页
Java英文面试题经典Word格式.docx_第3页
第3页 / 共20页
Java英文面试题经典Word格式.docx_第4页
第4页 / 共20页
Java英文面试题经典Word格式.docx_第5页
第5页 / 共20页
点击查看更多>>
下载资源
资源描述

Java英文面试题经典Word格式.docx

《Java英文面试题经典Word格式.docx》由会员分享,可在线阅读,更多相关《Java英文面试题经典Word格式.docx(20页珍藏版)》请在冰豆网上搜索。

Java英文面试题经典Word格式.docx

Transientvariablecan'

tbeserialize.ForexampleifavariableisdeclaredastransientinaSerializableclassandtheclassiswrittentoanObjectStream,thevalueofthevariablecan'

tbewrittentothestreaminsteadwhentheclassisretrievedfromtheObjectStreamthevalueofthevariablebecomesnull.

NamethecontainerswhichusesBorderLayoutastheirdefaultlayout?

ContainerswhichusesBorderLayoutastheirdefaultare:

window,FrameandDialogclasses.

WhatdoyouunderstandbySynchronization?

Synchronizationisaprocessofcontrollingtheaccessofsharedresources

TheCollectionAPIisasetofclassesandinterfacesthatsupportoperationoncollectionsofobjects.Theseclassesandinterfacesaremoreflexible,morepowerful,andmoreregularthanthevectors,arrays,andhashtablesifeffectivelyreplaces.

Exampleofclasses:

HashSet,HashMap,ArrayList,LinkedList,TreeSetandTreeMap.

Exampleofinterfaces:

Collection,Set,ListandMap.

 

IsIteratoraClassorInterface?

Whatisitsuse?

IteratorisaninterfacewhichisusedtostepthroughtheelementsofaCollection.

Whatissimilarities/differencebetweenanAbstractclassandInterface?

Differencesareasfollows:

Interfacesprovideaformofmultipleinheritance.Aclasscanextendonlyoneotherclass.

Interfacesarelimitedtopublicmethodsandconstantswithnoimplementation.Abstractclassescanhaveapartialimplementation,protectedparts,staticmethods,etc.

AClassmayimplementseveralinterfaces.Butincaseofabstractclass,aclassmayextendonlyoneabstractclass.

Interfacesareslowasitrequiresextraindirectiontofindcorrespondingmethodintheactualclass.Abstractclassesarefast.

Similarities:

NeitherAbstractclassesorInterfacecanbeinstantiated.

HowtodefineanAbstractclass?

AclasscontainingabstractmethodiscalledAbstractclass.AnAbstractclasscan'

tbeinstantiated.

ExampleofAbstractclass:

abstractclasstestAbstractClass{

protectedStringmyString;

publicStringgetMyString(){

returnmyString;

}

publicabstractstringanyAbstractFunction();

}

HowtodefineanInterface?

InJavaInterfacedefinesthemethodsbutdoesnotimplementthem.Interfacecanincludeconstants.AclassthatimplementstheinterfacesisboundtoimplementallthemethodsdefinedinInterface.

EmapleofInterface:

publicinterfacesampleInterface{

publicvoidfunctionOne();

publiclongCONSTANT_ONE=1000;

ExplaintheuserdefinedExceptions?

UserdefinedExceptionsaretheseparateExceptionclassesdefinedbytheuserforspecificpurposed.Anuserdefinedcancreatedbysimplysub-classingittotheExceptionclass.Thisallowscustomexceptionstobegenerated(usingthrow)andcaughtinthesamewayasnormalexceptions.

Example:

classmyCustomExceptionextendsException{

//Theclasssimplyhastoexisttobeanexception

}

ExplainthenewFeaturesofJDBC2.0CoreAPI?

TheJDBC2.0APIincludesthecompleteJDBCAPI,whichincludesbothcoreandOptionalPackageAPI,andprovidesinductrial-strengthdatabasecomputingcapabilities.

NewFeaturesinJDBC2.0CoreAPI:

Scrollableresultsets-usingnewmethodsintheResultSetinterfaceallowsprogrammaticallymovethetoparticularrowortoapositionrelativetoitscurrentposition

JDBC2.0CoreAPIprovidestheBatchUpdatesfunctionalitytothejavaapplications.

JavaapplicationscannowusetheResultSet.updateXXXmethods.

Newdatatypes-interfacesmappingtheSQL3datatypes

Custommappingofuser-definedtypes(UTDs)

Miscellaneousfeatures,includingperformancehints,theuseofcharacterstreams,fullprecisionforjava.math.BigDecimalvalues,additionalsecurity,andsupportfortimezonesindate,time,andtimestampvalues.

Explaingarbagecollection?

GarbagecollectionisoneofthemostimportantfeatureofJava.GarbagecollectionisalsocalledautomaticmemorymanagementasJVMautomaticallyremovestheunusedvariables/objects(valueisnull)fromthememory.Userprogramcann'

tdirectlyfreetheobjectfrommemory,insteaditisthejobofthegarbagecollectortoautomaticallyfreetheobjectsthatarenolongerreferencedbyaprogram.Everyclassinheritsfinalize()methodfromjava.lang.Object,thefinalize()methodiscalledbygarbagecollectorwhenitdeterminesnomorereferencestotheobjectexists.InJava,itisgoodideatoexplicitlyassignnullintoavariablewhennomoreinuse.IJavaoncallingSystem.gc()andRuntime.gc(),JVMtriestorecycletheunusedobjects,butthereisnoguaranteewhenalltheobjectswillgarbagecollected.

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 国外设计风格

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1