Dab tsi yog kev saib xyuas tsis raug cai hauv lub xeev kev zam hauv Java?
Dab tsi yog kev saib xyuas tsis raug cai hauv lub xeev kev zam hauv Java?

Video: Dab tsi yog kev saib xyuas tsis raug cai hauv lub xeev kev zam hauv Java?

Video: Dab tsi yog kev saib xyuas tsis raug cai hauv lub xeev kev zam hauv Java?
Video: Niam tij thiab tij laug xa ntsuag mus nrauj zoo 3/15/2018 2024, Kaum ib hlis
Anonim

Raws li tau piav qhia los ntawm cov ntaub ntawv raug cai, ib IllegalMonitorStateException tuaj yeem tshwm sim thaum xov sim tos ntawm ib qho khoom saib xyuas , lossis ceeb toom rau lwm cov xov uas tos rau cov khoom hais saib xyuas , thaum cov xov ntawd tsis muaj tus saib xyuas hauv nqe lus nug. Muab lwm txoj kev, yog Lub Object.

Xav txog qhov no, koj ua li cas Java Lang IllegalMonitorStateException?

Nyob rau hauv thiaj li yuav nrog rau IllegalMonitorStateException koj yuav tsum xyuas kom meej tias tag nrho cov invokations ntawm tos, ceeb toom thiab ceeb toomTxhua txoj kev yuav tshwm sim tsuas yog thaum lub xov tooj hu xov tooj yog tus tswv ntawm qhov tsim nyog saib. Txoj kev daws teeb meem yooj yim tshaj plaws yog txhawm rau kaw cov kev hu no hauv cov blocks synchronized.

Ib tug kuj yuav nug, Dab tsi yog IllegalThreadStateException hauv Java? IllegalThreadStateException . Lub runtime system cuam ib IllegalThreadStateException thaum koj hu ib txoj hauv xov thiab xov lub xeev tsis pub rau txoj kev hu. Piv txwv li, IllegalThreadStateException muab pov tseg thaum koj hu suspend() ntawm cov xov uas tsis yog "Runnable".

Xav txog qhov no, dab tsi yog tus saib xyuas hauv Java?

Hauv luv luv, a saib xyuas yog ib qho chaw uas saib xyuas cov xov 'kev nkag mus rau chav tshwj xeeb. Nws ua kom ntseeg tau tias tsuas yog ib txoj xov tuaj yeem nkag mus rau cov ntaub ntawv tiv thaiv lossis cov lej. 2. Nws siv li cas hauv Java ? Hauv Java virtual tshuab, txhua khoom thiab chav kawm yog logically txuam nrog a saib xyuas.

Java Lang IllegalStateException yog dab tsi?

pej xeem chav kawm IllegalStateException Extensions RuntimeException. Cov cim qhia tias ib txoj hauv kev tau raug hu rau lub sijhawm tsis raug cai lossis tsis tsim nyog. Hauv lwm lo lus, lub Java ib puag ncig los yog Java daim ntawv thov tsis nyob rau hauv lub xeev tsim nyog rau kev thov.

Pom zoo: