Qhov kawg hloov pauv yog dab tsi?
Qhov kawg hloov pauv yog dab tsi?

Video: Qhov kawg hloov pauv yog dab tsi?

Video: Qhov kawg hloov pauv yog dab tsi?
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim

kawg lo lus tseem ceeb hauv java. Ua ntej tshaj plaws, kawg yog ib qho kev hloov kho uas tsis siv tau tsuas yog siv rau a sib txawv , amethod los yog class. Hauv qab no yog cov ntsiab lus sib txawv qhov twg kawg yog siv. Qhov kawg hloov pauv . Thaum a sib txawv tau tshaj tawm nrog kawg lo lus tseem ceeb, nws tus nqi tsis tuaj yeem hloov kho, qhov tseem ceeb, qhov tsis tu ncua.

Ua li no, chav kawm kawg yog dab tsi?

A chav kawm kawg tsuas yog ib chav kawm uas tsis tuaj yeem txuas ntxiv. (Qhov no tsis txhais hais tias txhua qhov kev xa mus rau cov khoom ntawm lub chav kawm yuav ua raws li lawv tau tshaj tawm tias kawg .) Thaum nws muaj txiaj ntsig los tshaj tawm a chav kawm raws li kawg iscovered nyob rau hauv cov lus teb ntawm lo lus nug no: Zoo yog vim li cas rau txwv tsis pub nyob rau hauv Java?

Kuj Paub, Qhov Kawg Variable puas tuaj yeem hloov tau? Muaj ib qhov kawg variable speedlimit, peb yuav mus hloov tus nqi ntawm qhov no sib txawv , tab sis ua tau tsi be hloov vim qhov kawg variable ib zaug muab tus nqi ua tau yeej tsis yog hloov.

Ua li no, koj txhais li cas los ntawm qhov kawg hloov pauv hauv Java?

kawg variables nyob rau hauv Java . Hauv Java , thaum kawg lo lus tseem ceeb yog siv nrog a sib txawv ntawm primitivedata hom (int, ntab,.. etc), tus nqi ntawm cov sib txawv hloov tsis tau. Piv txwv li hauv qab no program muab errorbecause i yog kawg . Public class Test {

Koj siv qhov kawg hloov pauv hauv Java li cas?

A qhov kawg variable tuaj yeem qhia meej meej pib ib zaug. Ib qho kev siv sib txawv tshaj tawm kawg tsis tuaj yeem rov muab xa mus rau lwm yam khoom. Txawm li cas los xij, cov ntaub ntawv hauv qhov khoom tuaj yeem hloov pauv. Yog li, lub xeev ntawm cov khoom tuaj yeem hloov pauv tab sis tsis yog siv.

Pom zoo: