Cov chav kawm twg nyob rau sab saum toj ntawm kev zam hierarchy?
Cov chav kawm twg nyob rau sab saum toj ntawm kev zam hierarchy?

Video: Cov chav kawm twg nyob rau sab saum toj ntawm kev zam hierarchy?

Video: Cov chav kawm twg nyob rau sab saum toj ntawm kev zam hierarchy?
Video: leej twg tej ntxhai - Mang Vang [ Official MV ] 2024, Kaum ib hlis
Anonim

Tag nrho kev zam hom yog subclasses ntawm lub built-in chav kawm Pov tau. Yog li, Throwable yog nyob ntawm sab saum toj ntawm cov chav kawm tshwj xeeb hierarchy . Tam sim ntawd hauv qab Throwable yog ob subclasses uas muab faib kev zam nyob rau hauv ob qho tib si ceg.

Ntawm no, chav kawm twg yog nyob rau sab saum toj ntawm chav kawm tshwj xeeb hierarchy?

Cov saum peb chav kawm hauv qhov no hierarchy (Lub Pov Tseg, yuam kev, thiab Cov chav kawm tshwj xeeb ) yog txhua yam txhais hauv java. lang pob (uas yog cia li imported rau txhua chav kawm ntaub ntawv).

Ib tug kuj yuav nug, chav kawm twg yog lub hauv paus ntawm tag nrho kev zam tuav cov chav kawm hierarchy? Throwable class, uas yog ib qho subclass tam sim ntawd Yam khoom , yog nyob rau hauv lub hauv paus ntawm kev zam hierarchy. Throwable muaj ob lub subclasses tam sim no: Kev zam thiab yuam kev.

Ib yam li ntawd, koj tuaj yeem nug, koj puas tuaj yeem piav qhia txog qib siab ntawm kev zam tuav cov chav kawm?

Exception Hierarchy Tag nrho kev zam thiab yuam kev hom yog sub chav kawm ntawm chav kawm Throwable, uas yog lub hauv paus chav kawm ntawm hierarchy . Ib ceg yog coj los ntawm Kev zam . Qhov no chav kawm yog siv rau tshwj xeeb tej yam kev mob uas cov neeg siv cov kev pab cuam yuav tsum ntes . NullPointerException yog ib qho piv txwv ntawm tej ib qho kev zam.

Cov chav kawm twg yog siab tshaj hauv hierarchy hauv Java?

Cov Yam khoom class, hauv java. lang pob, zaum saum cov ntoo hierarchy. Txhua chav kawm yog ib tug xeeb leej xeeb ntxwv, ncaj los yog tsis ncaj, ntawm tus Yam khoom chav kawm. Txhua chav kawm uas koj siv lossis sau tau txais cov qauv piv txwv ntawm Yam khoom.

Pom zoo: