Qhov kev nqis tes ua twg raug txheeb xyuas thiab sib dhos?

Cov txheej txheem:

Qhov kev nqis tes ua twg raug txheeb xyuas thiab sib dhos?
Qhov kev nqis tes ua twg raug txheeb xyuas thiab sib dhos?
Anonim

The synchronizedSortedSet method ntawm java. siv. Cov chav kawm sau yog siv los xa rov qab ib qho synchronized (xov-zoo) sorted teem backed los ntawm cov teev sorted set.

Cov teeb twg yog synchronized hauv Java?

Koj paub, Vector thiab Hashtable yog ob qhov kev sau muaj nyob rau hauv keeb kwm Java, thiab lawv tau tsim los rau xov-kev nyab xeeb txij thaum pib (yog tias koj muaj sijhawm los saib. lawv qhov chaws, koj yuav pom lawv txoj kev yog synchronized!).

Yog TreeSet synchronized?

Txawm tias TreeSet tsis yog xov-kev nyab xeeb, nws tuaj yeem ua synchronized sab nraud siv cov Collections.

Daim ntawv twg yog synchronized hauv Java?

Yuav kom tau txais cov npe synchronized los ntawm ArrayList, peb siv synchronizedList(List) txoj hauv Java. Cov Collections. synchronizedList(List) txoj kev lees txais ArrayList raws li kev sib cav thiab xa rov qab cov npe xov xwm nyab xeeb.

Yuav ua li cas thiaj xaj hauv Java?

Interface SortedSet Ib Txheej uas ntxiv muab tag nrho kev txiav txim ntawm nws cov ntsiab lus. Cov ntsiab lus raug txiav txim siv lawv qhov kev txiav txim siab, lossis los ntawm Tus Sib Piv feem ntau yog muab los ntawm cov txheej txheem tsim lub sijhawm. Tus txheej txheem iterator yuav hla lub teeb hauv ascending element order.

Pom zoo: