Mitundu wosazindikira ku Java

Java ndi chinenero chinthu wokonda, koma osati kwathunthu, chifukwa chirichonse ndi chinthu. Tili otchedwa Mitundu wosazindikira!

mitundu wosazindikira

ndemanga

  • Zingwe si mitundu wosazindikira;
  • Kwa mtundu uliwonse wosazindikira deta pali lolingana Java kalasi;
  • lonse (mamvekedwe, lalifupi, Int, yaitali) iwo ali, zotsatira, Int, pali ntchito "L" kapena "L" pamene mukufuna kutanthauza yaitali;
  • Kwa mtundu decimal, ntchito “0×” mu hexadecimal (Int asanu = 0xF; // 15 decimal) imelo “0” chifukwa octal (Int × = 0931);
  • akuyandama mfundo (zimatengedwa, awiri) iwo ali, zotsatira, awiri, pali ntchito "f" kapena "F" kutanthauza zimatengedwa;
  • gale- ukufanizidwa ndi khalidwe Unicode 16 Akamva (unsigned);
  • mfundo Buliyani sangathe ntchito mu ntchito kuponyera;
  • Kuponyera ndi kutembenuka ntchito mtundu wina waukulu ku yocheperako (zolaula), Ex: yaitali Y = 10L; Int × = (Int) ndi;
  • Sikuti pamene akuponya mitundu ya chotsikitsitsa kupita apamwamba, ndi yovomerezeka (silinatchulidwe), Ex: Int Y = 10; yaitali × y n'zofanana;

mfundo zimenezi mlandu motere:

funso 1

COPEVE-UFAL – 2011 – UFAL – IT katswiri

Java mitundu wosazindikira deta ndi:
ndi) Buliyani, gale-, mamvekedwe, lalifupi, Int, yaitali, zimatengedwa, awiri.
b) Buliyani, chingwe, Int, zimatengedwa, awiri.
m'ma) Buliyani, chingwe, lalifupi, Int, yaitali, zimatengedwa, awiri.
D) Buliyani, gale-, Int, yaitali, zimatengedwa.
imelo) Buliyani, chingwe, mamvekedwe, Int, yaitali, zimatengedwa.

yankho 1

Zikuonekeratu kuti njira zina zonse kuti “chingwe” ndi mtundu wosazindikira ndi cholakwika. A letra D) Ndi chosakwanira, Choncho, kalata lamanzere) monga zolondola.


funso 2

Cesgranrio – 2008 – TJ-Ro – katswiri Judicial – Systems Analysis


mu Java, Potumiza anapeka = × + Y ndi lofanana × = (T) (× + ndi), kumene T ndi mtundu wa ×. Kuchokera pa chiyembekezo ichi, zotsatirazi mizere iwiri pulogalamu.

× + y n'zofanana;
× = × + ndi;

Mzere woyamba analemba, ndi mzere yachiwiri kupanga kulakwitsa kulemba nthawi, ngati × ndi Y amayesedwa, motero, monga:
ndi) lalifupi mauthenga Int
b) Int mauthenga lalifupi
m'ma) Int mauthenga gale-
D) Chingwe mauthenga Int
imelo) Int mauthenga chingwe

yankho 2

Funso ili chidwi, chimazinena mfundo zosiyanasiyana anati mawu ichi Post. Kwenikweni kumbukirani kuti inu muyenera kuchita kuponyera (kutembenuka zolaula) mtundu zikuluzikulu ndi zing'onozing'ono. mfundo ina ndi nsonga ya funsolo, pamene inu munena kuti × + Y = Matanthawuzo kuti × = (T) (× + ndi). Taonani kuti imeneyi, ndi kompayila amachita kuponyera (T), contario boma okha × = × + ndi. ndipo pomalizira, dziwani kuti funso akufuna kudziwa njira choyamba mzere kulemba, ndi mzere yachiwiri kupanga kulakwitsa. Kotero izo zikuwoneka ngati:

ndi) Pamene × ndi a mtundu Int, ndi waufupi ndi, tiyenera kuponyera chifukwa kupanga cholakwa, pois lalifupi (16 Akamva) E zosakwana Int (32 Akamva), mwakulankhula kwina, lalifupi Int sangathe pokhapokha kutembenuka zolaula (kuponyera). Choncho, monga × + Y = × ndi lofanana = (T) (× + ndi), tili × = (lalifupi) (× + ndi). Onani kuponyera chidachitika molondola ndipo sipadzakhala vuto akatembenuka. Mu mzere wachiwiri (× = × + ndi), palibe kuponyera chofunika kwambiri (Int) kwa chotsikitsitsa (lalifupi), Zimenezi zidzathandiza zolakwa kalembera. Izi ndi lolondola zina, Pakuti kwadziwikadi kuti mzere oyamba adzakhala kulemba, ndi mzere yachiwiri kupanga kulakwitsa.

b) Apa ife tiri nazo zonse mzere woyamba, monga yachiwiri kulemba popanda mavuto, chifukwa kutembenuka mfundo yaikulu (zazikulu ndi zazing'ono yaikulu palokha kuponyera), popeza Int (×) kuti adzalandira lalifupi (ndi) mawu a × = × + ndi. Iwo sakanakhoza kukhala njirayi, chifukwa mizere onse awiri kulemba.

m'ma) Onse mizere adzakhala kulemba molondola, zifukwa zofanana anafotokoza mu b). Kuphatikizapo gale- alinso 16 Akamva, yaifupi. Kusiyana komwe kulipo ndi pamene akuchita ndalama Int + Char mawu a × = × + ndi, Iwo tidzakambirana ASCII malamulo a khalidwe (gale-) ntchito. Mwachitsanzo, 97 limafanana ndi khalidwe 'ndi’ tebulo ASCII.

D) Onse mizere adzakhala kulemba molondola. Chifukwa pano ndi kuti kompayila amaona chizindikiro + monga concatenation (mphambano) osati ndalama, akatembenuka Int (ndi) zigwireni chingwe (×), pamene inu muyenda mawu a × = × + ndi.

imelo) Onse mizere sadzakhala kulemba, chifukwa palibe njira kutembenuza chingwe (ndi) chifukwa Int (×) pamene inu muyenda mawu a × = × + ndi.

Chiwerengero cha kumenya: 7207

2 ndemanga “Mitundu wosazindikira ku Java

Siyani Mumakonda

Anu email sati lofalitsidwa. Amafuna minda amalembedwa ndi *