Cov ntaub ntawv tseem ceeb nyob qhov twg?

Cov txheej txheem:

Cov ntaub ntawv tseem ceeb nyob qhov twg?
Cov ntaub ntawv tseem ceeb nyob qhov twg?

Video: Cov ntaub ntawv tseem ceeb nyob qhov twg?

Video: Cov ntaub ntawv tseem ceeb nyob qhov twg?
Video: qhia siv website mediafire rau tej ntaub ntawv tseem ceeb| VajYaj Graphic 2024, Kaum ib hlis
Anonim

2. Hom ntaub ntawv Primitive. Yim lub ntsiab lus txhais hauv Java yog int, byte, luv, ntev, ntab, ob npaug, boolean, thiab char - cov no tsis suav tias yog cov khoom thiab sawv cev rau cov nqi nyoos. Lawv nyob nraum khaws cia ncaj qha rau ntawm pawg(saib cov tshooj no kom paub ntau ntxiv txog kev tswj hwm kev nco hauv Java).

Cov ntaub ntawv tseem ceeb khaws cia nyob qhov twg?

Stack memory khaws cov hom qub thiab qhov chaw nyob ntawm cov khoom. Cov khoom muaj nqis yog khaws cia hauv heap nco.

Yuav ua li cas yog cov ntaub ntawv thawj zaug?

Nyob rau hauv JavaScript, ib qho tseem ceeb (primitive value, primitive data type) yog cov ntaub ntawv uas tsis yog khoom thiab tsis muaj txoj hauv kev. Muaj 7 cov ntaub ntawv keeb kwm yav dhau los: txoj hlua, tus lej, bigint, boolean, undefined, cim, thiab null.

Cov hom qub khaws cia hauv Java nyob qhov twg?

hom Primitive tshaj tawm hauv zos yuav nyob ntawm the stack thaum cov hom qub uas tau txiav txim siab ua ib feem ntawm cov khoom piv txwv yog khaws cia rau hauv heap. Cov hloov pauv hauv zos tau muab khaws cia rau hauv pawg thaum piv txwv thiab cov hloov pauv zoo li qub tau khaws cia rau hauv heap.

Cov ntaub ntawv khaws cia hauv hom thawj zaug tswj hwm li cas?

Primitive data type yog khaws cia rau hauv lub cim xeeb ntawm Pawg, tsis yog hauv Heap nco, qhov khoom khaws cia. Qhov no ua rau kev tswj hwm lub cim xeeb, yooj yim dua thiab ua haujlwm tau zoo. Muaj chav kawm Wrapper, rau txhua yam ntawm cov ntaub ntawv keeb kwm yav dhau los, uas tso cai rau khaws cov ntaub ntawv tib yam, tab sis siv cov khoom siv.

Pom zoo: