Cov txheej txheem:

Koj ua li cas piv cov nqi ntawm daim ntawv qhia?
Koj ua li cas piv cov nqi ntawm daim ntawv qhia?

Video: Koj ua li cas piv cov nqi ntawm daim ntawv qhia?

Video: Koj ua li cas piv cov nqi ntawm daim ntawv qhia?
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla use for? 2024, Hlis ntuj nqeg
Anonim

Txoj hauv kev kom yog los sib piv cov duab qhia txog tus nqi sib npaug yog:

  1. Xyuas tias cov daim ntawv qhia yog tib qhov loj (!)
  2. Tau cov yuam sij ntawm ib qho daim ntawv qhia .
  3. Rau txhua tus yuam sij los ntawm qhov teeb tsa koj tau rov qab, xyuas tias qhov tus nqi tau txais los ntawm txhua tus daim ntawv qhia rau tus yuam sij ntawd yog tib yam (yog tias tus yuam sij tsis tuaj ntawm ib qho daim ntawv qhia , qhov ntawd yog tag nrho kev tsis sib haum xeeb)

Tsis tas li ntawd, koj piv Hashmaps li cas?

Yog peb xav tau piv hashmaps los ntawm cov yuam sij i.e. ob hashmaps yuav sib npaug yog tias lawv muaj cov yuam sij tib yam, peb tuaj yeem siv HashMap . keySet() muaj nuj nqi. Nws rov qab tag nrho daim ntawv qhia yuam sij hauv HashSet. Peb ua tau piv lub hashset ntawm cov yuam sij rau ob daim ntawv qhia siv Set.

Ib yam li ntawd, peb puas tuaj yeem sib piv ob daim duab qhia hauv C ++? Cov daim ntawv qhia ::key_comp() yog ib qho haujlwm hauv STL hauv C++ uas xa rov qab ib daim qauv ntawm kev sib piv khoom siv los ntawm lub thawv uas piv yuam sij. Rov qab tus nqi: Txoj kev no rov qab cov kev sib piv khoom siv los ntawm lub thawv uas piv yuam sij. // C++ program los ua qauv qhia daim ntawv qhia ::key_comp().

Tsis tas li, koj ua li cas piv ob Arraylists?

Koj ua tau piv ob array npe siv cov equals() method of the ArrayList chav kawm, txoj kev no lees txais cov npe khoom raws li qhov ntsuas, piv nrog cov khoom tam sim no, nyob rau hauv rooj plaub ntawm qhov sib tw nws rov qab muaj tseeb thiab yog tias tsis yog nws rov qab tsis tseeb.

Koj piv cov khoom hauv Java li cas?

Yuav tau piv ob Java khoom ntawm tib chav kawm qhov boolean sib npaug ( Yam khoom obj) txoj kev yuav tsum tau overriden thiab siv los ntawm chav kawm. Tus neeg siv txiav txim siab seb qhov twg yuav tsum sib npaug los xav txog ob khoom kom sib npaug.

Pom zoo: