Java puas tuaj yeem ua qhov tsis zoo?
Java puas tuaj yeem ua qhov tsis zoo?

Video: Java puas tuaj yeem ua qhov tsis zoo?

Video: Java puas tuaj yeem ua qhov tsis zoo?
Video: Ntsaim Vaj - Tsis Tshuav Dab Tsis Zoo Lawm (New Official MV 2023) 2024, Kaum ib hlis
Anonim

Yog vim li cas Java tsis pov ib qho kev zam thiab koj tau txais tsis zoo cov lej tau ua nrog cov lej khaws cia. Rau ib ntev primitive thawj byte yog siv los qhia cov cim ntawm tus lej (0 -> zoo, 1 -> tsis zoo ), hos tus so yog siv rau tus nqi zauv. Qhov no txhais tau tias Ntev.

Cov lus nug tseem yog, ntev npaum li cas tuaj yeem muaj qhov tsis zoo?

Yog lawm ua kev txhawb nqa qhov tsis zoo raws li ntev raws li nws tsis ntxiv tom qab unsigned.

Tsis tas li ntawd, cov ntaub ntawv tseem ceeb yog dab tsi uas yuav tsis tso cai rau tus nqi tsis zoo? char

Ib tug kuj yuav nug, dab tsi yog qhov txwv ntev hauv Java?

ntev : Cov ntev cov ntaub ntawv hom yog 64-ntsis ob qhov sib xyaw ua ke. Qhov kos npe ntev muaj qhov tsawg kawg nkaus tus nqi ntawm -263 thiab a siab kawg tus nqi ntawm 263-1. Hauv Java SE 8 thiab tom qab ntawd, koj tuaj yeem siv lub ntev hom ntaub ntawv los sawv cev rau qhov tsis tau kos npe 64-ntsis ntev , uas muaj qhov tsawg kawg nkaus tus nqi ntawm 0 thiab a siab kawg tus nqi ntawm 264-1.

Dab tsi yog qhov luv luv hauv Java?

Java Yim Yam Cov Ntaub Ntawv Tseem Ceeb

Hom Loj hauv Bytes Ntau yam
byte 1 byte ib -128-127: kuv
luv 2 bytes -32, 768 to 32, 767 ib
int 4 bytes 2, 147, 483, 648 rau 2, 147, 483, 647
ntev 8 bytes -9, 223, 372, 036, 854, 775, 808 to 9, 223, 372, 036, 854, 775, 807

Pom zoo: