Umsebenzisi ngamunye okungenani kanye, kepha wacabanga ngokwakha uhlelo lakhe elihlukile elizokwenza lezo zenzo kuphela umsebenzisi ngokwakhe azocela zona. Lokho kungaba kuhle. Ukuze wakhe noma yiluphi uhlelo oludingayo ulwazi wanoma yiluphi ulimi. Yiphi? Nguwe kuphela okhethayo, ngoba ukunambitheka nombala wazo zonke izimpawu kuhlukile.
Sizobheka ukuthi ungabhala kanjani uhlelo eJava. I-Java ingenye yezilimi ezaziwa kakhulu nezinethembisayo zokuhlela. Ukusebenza nolimi, sizosebenzisa imvelo yezinhlelo ze-IntelliJ IDEA. Vele, ungadala izinhlelo ku-Notepad ejwayelekile, kepha ukusebenzisa i-IDE ekhethekile kusasebenza kakhulu, ngoba imvelo ngokwayo izokhombisa amaphutha kuwe futhi ikusize uhlele.
Landa i-IntelliJ IDEA
Ukunaka!
Ngaphambi kokuthi uqale, qiniseka ukuthi unayo inguqulo yakamuva yeJava efakiwe.Landa inguqulo yakamuva yeJava
Ungayifaka kanjani i-IntelliJ IDEA
1. Landela isixhumanisi esingenhla bese uqhafaza ku-Download;
2. Uzodluliselwa ekukhetheni kwenguqulo. Khetha uhlobo lwamahhala lomphakathi bese ulinda ifayela ukuthi ulilande;
3. Faka uhlelo.
Ungayisebenzisa kanjani i-IntelliJ IDEA
1. Qalisa uhlelo bese wakhe iphrojekthi entsha;
2. Ewindini elivulayo, qiniseka ukuthi ulimi oluhlelayo lukhethwe yiJava bese uqhafaza u- "Okulandelayo";
3. Chofoza u- "Okulandelayo" futhi. Ewindini elilandelayo, chaza indawo yefayela negama lephrojekthi. Chofoza Qeda.
4. Iwindi leprojekthi selivulekile. Manje udinga ukufaka ikilasi. Ukuze wenze lokhu, vula ifolda yephrojekthi bese uqhafaza kwesokudla kufolda ye-src, "Okusha" -> "Java Class".
5. Setha igama lekilasi.
6. Futhi manje sesingaqhubeka ngqo nohlelo. Ungalwakha kanjani uhlelo lwekhompyutha? Kulula kakhulu! Uvule inkambu yokuhlela umbhalo. Yilapho sizobhala khona ikhodi yohlelo.
7. Isigaba esikhulu senziwa ngokuzenzakalelayo. Kulesi sigaba, bhala indlela eyi-main static void main (String [] args) bese ubeka ama-curly brings {}. Iphrojekthi ngayinye kufanele ibe nendlela eyodwa eyinhloko.
Ukunaka!
Lapho ubhala uhlelo, udinga ukubheka ngokucophelela syntax. Lokhu kusho ukuthi yonke imiyalo kufanele ipelwe ngokufanele, wonke amabakaki avulekile kufanele avalwe, isemicolon kufanele ibekwe ngemuva komugqa ngamunye. Ungakhathazeki - imvelo izokusiza futhi ikuxhase.
8. Njengoba sibhala uhlelo olulula kakhulu, kusala kuphela ukwengeza i-Command.out.print yomyalo ("Sawubona, umhlaba!");
9. Qhafaza kwesokudla kwigama lekilasi bese ukhetha u- "Run".
10. Uma konke kwenziwa kahle, okufakiwe "Sawubona, mhlaba!" Kuzokhonjiswa ngezansi.
Halala! Usanda kubhala uhlelo lwakho lokuqala lweJava.
Lokhu kumane nje kuyizisekelo zokuhlela. Uma uzibophezele ekufundeni ulimi, khona-ke ungakha amaphrojekthi amakhulu kakhulu futhi awusizo kunelesi esithi "Sawubona wezwe!"
Futhi i-IntelliJ IDEA izokusiza ngalokhu.
Landa i-IntelliJ IDEA kuwebhusayithi esemthethweni
Bheka futhi: Ezinye izinhlelo zokuhlela