Dab tsi yog siv cov lus tseem ceeb hauv Java?
Dab tsi yog siv cov lus tseem ceeb hauv Java?

Video: Dab tsi yog siv cov lus tseem ceeb hauv Java?

Video: Dab tsi yog siv cov lus tseem ceeb hauv Java?
Video: ET Yaj - Yog Hmoov Dab Tsi 2024, Hlis ntuj nqeg
Anonim

Java Programming/Keywords/ tsis muaj dab tsi . tsis muaj dab tsi yog a Java lo lus tseem ceeb . Siv ntawm txoj kev tshaj tawm thiab kev txhais kom meej meej tias txoj kev tsis rov qab txhua yam, txoj kev rov qab los tsis muaj dab tsi . Nws tsis yog hom thiab tsis muaj tsis muaj dab tsi cov ntaub ntawv / pointers xws li hauv C / C ++.

Ua raws li qhov no hauv kev txiav txim siab, vim li cas peb thiaj siv tsis muaj nyob hauv Java?

Tsis muaj yog siv thaum koj tab tom tsim ib chav kawm uas yuav tsis rov qab muaj nuj nqis. Java ib txwm yuav tsum paub tias yuav tsum tau ua dab tsi. Yog li yog tias koj yuav tau txais ib txoj hlua tom qab ua qhov kev txiav txim koj yuav tau sau cov hlua, yog tias koj vam tus lej koj yuav sau npe rau int, ob npaug, lossis yam twg tus lej yuav rov qab los.

Ib yam li ntawd, qhov txawv ntawm pej xeem tsis muaj dab tsi thiab pej xeem void hauv Java yog dab tsi? Public void : Siv thaum koj tsis tas yuav tsim ib yam khoom thiab tsis muaj rov qab los. Public static void : Siv thaum koj xav tau los tsim ib yam khoom hauv chav nws tus kheej. Public 'rov qab hom' ( Public int, Public Txoj hlua, Public double): Qhov no yog siv thaum koj xav tau rov qab ib yam dab tsi.

Tsuas yog li ntawd, vim li cas cov pej xeem tseem ceeb tsis muaj dab tsi nyob hauv Java?

Java cov program lub ntsiab txoj kev yuav tsum tau tshaj tawm zoo li qub vim keyword zoo li qub tso cai lub ntsiab kom raug hu tsis tsim ib yam khoom ntawm chav kawm uas tus lub ntsiab txoj kev yog txhais. Yog peb omit zoo li qub lo lus tseem ceeb ua ntej main Java program yuav ua tiav compile tab sis nws yuav tsis ua.

Cov txheej txheem tsis muaj dab tsi yog dab tsi?

Cov tsis muaj dab tsi Lo lus tseem ceeb no txoj kev yog a txoj kev tsis muaj dab tsi , uas tsis rov qab muaj nuj nqis. Hu rau a txoj kev tsis muaj dab tsi yuav tsum yog ib nqe lus piv txwv li methodRankPoints(255.7); Nws yog Java nqe lus uas xaus nrog semicolon raws li qhia hauv cov piv txwv hauv qab no.

Pom zoo: