Question:NamethecontainerswhichusesBorderLayoutastheirdefaultlayout?Answer:ContainerswhichusesBorderLayoutastheirdefaultare:window,FrameandDialogclasses.Question:WhatdoyouunderstandbySynchronization?Answer:Synchronizationisaprocessofcontrollingtheaccessofsharedresourcesbythemultiplethreadsinsuchamannerthatonlyonethreadcanaccessoneresourceatatime.Innonsynchronizedmultithreadedapplication,itispossibleforonethreadtomodifyasharedobjectwhileanotherthreadisintheprocessofusingorupdatingtheobject'svalue.Synchronizationpreventssuchtypeofdatacorruption.E.g.Synchronizingafunction:publicsynchronizedvoidMethod1(){//Appropriatemethod-relatedcode.}E.g.Synchronizingablockofcodeinsideafunction:publicmyFunction(){synchronized(this){//Synchronizedcodehere.}}Question:WhatisCollectionAPI?Answer:TheCollectionAPIisasetofclassesandinterfacesthatsupportoperationoncollectionsofobjects.Theseclassesandinterfacesaremoreflexible,morepowerful,andmoreregularthanthevectors,arrays,andhashtablesifeffectivelyreplaces.Exampleofclasses:HashSet,HashMap,ArrayList,LinkedList,TreeSetandTreeMap.Exampleofinterfaces:Collection,Set,ListandMap.Question:IsIteratoraClassorInterface?Whatisitsuse?Answer:IteratorisaninterfacewhichisusedtostepthroughtheelementsofaCollection.Question:Whatissimilarities/differencebetweenanAbstractclassandInterface?Answer:Differencesareasfollows:Interfacesprovideaformofmultipleinheritance.Aclasscanextendonlyoneotherclass.Interfacesarelimitedtopublicmethodsandconstantswithnoimplementation.Abstractclassescanhaveapartialimplementation,protectedparts,staticmethods,etc.AClassmayimplementseveralinterfaces.Butincaseofabstractclass,aclassmayextendonlyoneabstractclass.Interfacesareslowasitrequiresextraindirectiontotofindcorrespondingmethodinintheactualclass.Abstractclassesarefast.Similarities:NeitherAbstractclassesorInterfacecanbeinstantiated.Question:HowtodefineanAbstractclass?Answer:AclasscontainingabstractmethodiscalledAbstractclass.AnAbstractclasscan'tbeinstantiated.ExampleofAbstractclass:abstractclasstestAbstractClass{protectedStringmyString;publicStringgetMyString(){returnmyString;}publicabstractstringanyAbstractFunction();}Question:HowtodefineanInterface?Answer:InJavaInterfacedefinesthemethodsbutdoesnotimplementthem.Interfacecanincludeconstants.AclassthatimplementstheinterfacesisboundtoimplementallthemethodsdefinedinInterface.EmapleofInterface:publicinterfacesampleInterface{publicvoidfunctionOne();publiclongCONSTANT_ONE=1000;}Question:ExplaintheuserdefinedExceptions?Answer:UserdefinedExceptionsaretheseparateExceptionclassesdefinedbytheuserforspecificpurposed.Anuserdefinedcancreatedbysimplysub-classingittotheExceptionclass.Thisallowscustomexceptionstobegenerated(usingthrow)andcaughtinthesamewayasnormalexceptions.Example:classmyCustomExceptionextendsException{//Theclasssimplyhastoexisttobeanexception}Question:ExplainthenewFeaturesofJDBC2.0CoreAPI?Answer:TheJDBC2.0APIincludesthecompleteJDBCAPI,whichincludesbothcoreandOptionalPackageAPI,andprovidesinductrial-strengthdatabasecomputingcapabilities.NewFeaturesinJDBC2.0CoreAPI:Scrollableresultsets-usingnewmethodsintheResultSetinterfaceallowsprogrammaticallymovethetoparticularrowortoapositionrelativetoitscurrentpositionJDBC2.0CoreAPIprovidestheBatchUpdatesfunctionalitytothejavaapplications.JavaapplicationscannowusetheResultSet.updateXXXmethods.Newdatatypes-interfacesmappingtheSQL3datatypesCustommappingofuser-definedtypes(UTDs)Miscellaneousfeatures,includingperformancehints,theuseofcharacterstreams,fullprecisionforjava.math.BigDecimalvalues,additionalsecurity,andsupportfortimezonesindate,time,andtimestampvalues.Question:Explaingarbagecollection?Answer:GarbagecollectionisoneofthemostimportantfeatureofJava.GarbagecollectionisalsocalledautomaticmemorymanagementasJVMautomaticallyremovestheunusedvariables/objects(valueisnull)fromthememory.Userprogramcann'tdirectlyfreetheobjectfrommemory,insteaditisthejobofthegarbagecollectortoautomaticallyfreetheobjectsthatarenolongerreferencedbyaprogram.Everyclassinheritsfinalize()methodfromjava.lang.Object,thefinalize()methodiscalledbygarbagecollectorwhenitdeterminesnomorereferencestotheobjectexists.InJava,itisgoodideatoexplicitlyassignnullintoavariablewhennomoreinuse.IJavaoncallingSystem.gc()andRuntime.gc(),JVMtriestorecycletheunusedobjects,butthereisnoguaranteewhenalltheobjectswillgarbagecollected.Question:Howyoucanforcethegarbagecollection?Answer:Garbagecollectionautomaticprocessandcan'tbeforced.Question:WhatisOOPS?Answer:OOPisthecommonabbreviationforObject-OrientedProgramming.Question:DescribetheprinciplesofOOPS.Answer:TherearethreemainprincipalsofoopswhicharecalledPolymorphism,InheritanceandEncapsulation.Question:ExplaintheEncapsulationprinciple.Answer:Encapsulationisaprocessofbindingorwrappingthedataandthecodesthatoperatesonthedataintoasingleentity.Thiskeepsthedatasafefromoutsideinterfaceandmisuse.Onewaytothinkaboutencapsulationisasaprotectivewrapperthatpreventscodeanddatafrombeingarbitrarilyaccessedbyothercodedefinedoutsidethewrapper.Question