Puas yog hom primitive muaj txoj hauv kev?
Puas yog hom primitive muaj txoj hauv kev?

Video: Puas yog hom primitive muaj txoj hauv kev?

Video: Puas yog hom primitive muaj txoj hauv kev?
Video: Puas Yog Tim Nyiaj? Cover (Official Music Video 2023) Ncais Vaj 2024, Kaum ib hlis
Anonim

Vim String tsis yog ib hom qub , nws yog chav kawm (uas muaj txoj kev ), whereas integer, short, char etc. yog tag nrho keeb kwm (uas tsis yog muaj txoj kev ). Vim hom thawj zaug tsuas yog tias, keeb kwm . Lawv tsis ua muaj txoj kev.

Tom qab ntawd, ib tus tuaj yeem nug, puas cov ntaub ntawv keeb kwm yav dhau los muaj txoj hauv kev?

Ib ' keeb kwm ' hom ntaub ntawv txhais tau tias koj muaj tus nqi khaws cia hauv nco--tus nqi no muaj tsis muaj txoj kev los yog tus qauv sab hauv. A primitive tau tsuas yog ua los ntawm kev ua haujlwm sab nraud.

Tsis tas li ntawd, puas yog cov khoom qub qub? Muaj 8 hom ntaub ntawv qub : int, luv, char, ntab, ob, boolean, … thiab lwm yam. Tsis zoo li C#, Hauv Java, hloov pauv ntawm a hom qub tsis yog Yam khoom ; lawv tsis yog struct los yog ib tug khoom instantiated los ntawm ib chav kawm.

Ntawm no, dab tsi yog cov txheej txheem primitive?

A txheej txheem qub yog a Txoj kev uas invokes tus cwj pwm nyob rau hauv lub Virtual Machine (Xeem) los yog ib tug plugin. Cov txheej txheem tseem ceeb muab kev ua haujlwm uas tsis muaj los ntawm ib txwm Smalltalk txoj kev . Piv txwv li, muaj txheej txheem qub rau I/O Piv txwv li: nkag mus rau cov ntaub ntawv (Saib FileStream) network sockets (saib Socket)

Dab tsi yog qhov sib txawv ntawm cov ntaub ntawv qub thiab tsis yog cov ntaub ntawv qub?

Cov ntaub ntawv tseem ceeb tsuas yog ib qho txiaj ntsig xwb, lawv tsis muaj peev xwm tshwj xeeb. Cov piv txwv ntawm Primitive data yam muab byte, luv, int, ntev, ntab, ob npaug, char thiab lwm yam A tsis yog - hom ntaub ntawv qub yog lwm yam xws li cov qauv array lossis chav kawm hu ua tsis yog - hom ntaub ntawv qub.

Pom zoo: