Dab tsi yog default string value?
Dab tsi yog default string value?

Video: Dab tsi yog default string value?

Video: Dab tsi yog default string value?
Video: Data Science with Python! Joining Tables Without a Common Column 2024, Kaum ib hlis
Anonim

Vim hlua yog hom siv, siv hom yog tus nqi pib yog null. str yog a txoj hlua , yog li nws yog hom siv, yog li tus nqi pib yog null. int str = ( ua ntej ) (ib); str yog int, yog li nws yog a tus nqi typ, so tus nqi pib yog zero.

Ib yam li ntawd, koj tuaj yeem nug, dab tsi yog int default value?

variables ( tus nqi hom) yog implicitely pib rau cov tus nqi pib . Rau int ,,yog 0.

Ib sab saum toj no, dab tsi yog tus nqi pib ntawm enum C#? Los ntawm ua ntej , thawj tus tswv cuab ntawm ib qho enum muaj cov tus nqi 0i ua tus nqi ntawm txhua qhov txuas ntxiv enum tus tswv cuab yog nce los ntawm 1. Rau Piv txwv li, nyob rau hauv cov nram qab no enumeration, Monday yog 0, Tuesday yog 1, Wednesday yog 2 thiab lwm yam.

Ntxiv mus, dab tsi yog tus nqi pib ntawm Boolean?

Tus nqi pib rau boolean (primitive) yog cuav. Tus nqi pib ntawm ib qho Yam khoom , xws li Boolean, yog null. Tus nqi pib rau boolean yog cuav.

Dab tsi yog tus nqi pib ntawm nullable int?

Nullable < int > i = null; A nullable hom tuaj yeem sawv cev qhov tseeb ntawm nqi rau nws lub hauv paus tus nqi hom, ntxiv ib qho ntxiv null tus nqi . Rau piv txwv, Nullable < int > tuaj yeem muab rau ib qho tus nqi los ntawm -2147483648 rau 2147483647, los yog tsis muaj tus nqi.

Pom zoo: