Dab tsi yog Boolean primitive?
Dab tsi yog Boolean primitive?

Video: Dab tsi yog Boolean primitive?

Video: Dab tsi yog Boolean primitive?
Video: Yog hmoov dab tsi - Gao Nou Kue ft. Mang Vang (Official Music Video) New song 2020 2024, Kaum ib hlis
Anonim

Cov boolean Primitive . Cov ntaub ntawv yooj yim tshaj plaws muaj rau koj hauv Java yog keeb kwm hom boolean . A boolean variable tsuas muaj ob qhov tseem ceeb, qhov tseeb lossis tsis tseeb, uas sawv cev nrog cov lus tshwj tseg. boolean variables feem ntau siv thaum koj xav kom taug qab lub xeev ntawm ib tug yooj yim khoom attribute.

Ib yam li ntawd, koj tuaj yeem nug, qhov piv txwv ntawm Boolean yog dab tsi?

A Boolean variable tsuas muaj ob qhov tseem ceeb: muaj tseeb lossis cuav. Nws yog ib qho uas siv Booleans nrog cov lus tswj xyuas los txiav txim qhov ntws ntawm qhov kev pab cuam. Hauv no piv txwv , thaum boolean tus nqi "x" yog qhov tseeb, ntsug dub kab yog kos thiab thaum lub boolean tus nqi "x" yog cuav, kab rov tav grey yog kos.

Ib yam li ntawd, kuv yuav tsum siv Boolean lossis Boolean? Nws raug pom zoo tias koj siv tus Boolean () ua haujlwm los hloov tus nqi ntawm ib hom sib txawv rau a Boolean ntaus tab sis koj yuav tsum yeej tsis siv tus Boolean raws li ib tug wrapper khoom ntawm ib tug primitive boolean tus nqi.

Qhov thib ob, dab tsi yog tus nqi qub?

Ib qho kev sib txawv tuaj yeem tuav ib qho ntawm ob tus nqi hom: qhov tseem ceeb los yog siv tus nqi . Primitive nqi yog cov ntaub ntawv uas khaws cia rau hauv pawg. Primitive nqi yog khaws cia ncaj qha rau hauv qhov chaw uas qhov sib txawv nkag mus. Keeb kwm hom muaj xws li Undefined, Null, Boolean, Number, lossis String.

Boolean siv rau dab tsi?

Boolean hais txog ib qho kev xav ntawm kev xav uas yog siv los tsim cov lus tseeb / cuav. A Boolean tus nqi qhia tus nqi tseeb (uas tuaj yeem yog qhov tseeb lossis tsis tseeb). Boolean logic yog tsim los ntawm George Boole, ib tug English mathematician thiab philosopher, thiab tau los ua lub hauv paus ntawm niaj hnub digital computer logic.

Pom zoo: