1.DoIneedtousesynchronizedonsetValue(int)?-Itdependswhetherthemethodaffectsmethodlocalvariables,classstaticorinstancevariables.Ifonlymethodlocalvariablesarechanged,thevalueissaidtobeconfinedbythemethodandisnotpronetothreadingissues.2.DoIneedtousesynchronizedonsetValue(int)?-Itdependswhetherthemethodaffectsmethodlocalvariables,classstaticorinstancevariables.Ifonlymethodlocalvariablesarechanged,thevalueissaidtobeconfinedbythemethodandisnotpronetothreadingissues.3.WhatistheSwingUtilities.invokeLater(Runnable)methodfor?-ThestaticutilitymethodinvokeLater(Runnable)isintendedtoexecuteanewrunnablethreadfromaSwingapplicationwithoutdisturbingthenormalsequenceofeventdispatchingfromtheGraphicalUserInterface(GUI).ThemethodplacestherunnableobjectinthequeueofAbstractWindowingToolkit(AWT)eventsthatareduetobeprocessedandreturnsimmediately.Therunnableobject’srun()methodisonlycalledwhenitreachesthefrontofthequeue.ThedeferredeffectoftheinvokeLater(Runnable)methodensuresthatanynecessaryupdatestotheuserinterfacecanoccurimmediately,andtherunnableworkwillbeginassoonasthosehighpriorityeventsaredealtwith.Theinvokelatermethodmightbeusedtostartworkinresponsetoabuttonclickthatalsorequiresasignificantchangetotheuserinterface,perhapstorestrictotheractivities,whiletherunnablethreadexecutes.4.Whatisthevolatilemodifierfor?-ThevolatilemodifierisusedtoidentifyvariableswhosevaluesshouldnotbeoptimizedbytheJavaVirtualMachine,bycachingthevalueforexample.Thevolatilemodifieristypicallyusedforvariablesthatmaybeaccessedormodifiedbynumerousindependentthreadsandsignifiesthatthevaluemaychangewithoutsynchronization.5.Whichclassisthewait()methoddefinedin?-Thewait()methodisdefinedintheObjectclass,whichistheultimatesuperclassofallothers.SotheThreadclassandanyRunnableimplementationinheritthismethodfromObject.Thewait()methodisnormallycalledonanobjectinamulti-threadedprogramtoallowotherthreadstorun.Themethodshouldshouldonlybecalledbyathreadthathasownershipoftheobject’smonitor,whichusual...