KodeGym/Kursus Jawa/2. modul: Java Core/Pelajaran tambahan kanggo level

Pelajaran tambahan kanggo level

kasedhiya

Apa generik ing basa Jawa?

Ing wulangan iki , kita ngomong babagan generik. Utawa, babagan dhasar sing sampeyan kudu ngerti nalika nyilem menyang generik: generik apa lan kenapa sampeyan butuh kabeh. Topik kasebut penting banget, lan sampeyan kudu ngerti. Maju!

Generik kanggo kucing

Generik minangka alat sing apik kanggo mbantu pangembang menehi informasi tambahan menyang kompiler kanggo keamanan lan keluwesan jinis. Artikel sing jero iki , sing ditulis dening anggota komunitas CodeGym, njupuk puteran liyane babagan "generik".

Tipe erasure

Pawulangan iki dikhususake kanggo sawetara fitur generik uga pitfalls sing muncul nalika nggarap. Amarga generik dudu bagéan saka basa Jawa nalika basa digawe, jinis erasure wis ditambahake. opo iku? Kita bakal ngerti.

Wildcards ing generik

Wildcards minangka fitur generik sing penting banget lan mesthi pantes diwenehi pelajaran sing kapisah . Iki minangka topik sing menarik lan prasaja. Sampeyan bakal seneng :)

Nggunakake varargs nalika nggarap generik

Nggunakake varargs karo generik bisa nyebabake akibat sing ora nyenengake - polusi tumpukan. Ing wulangan iki , kita nyimpulake diskusi babagan macem-macem fitur generik ing basa Jawa.

4
tugas
Java Core,  tingkatwulangan
Dikunci
Something superfluous
Our program is once again full of unnecessary lines of code. Let's correct this blunder by removing all the extra methods, so that the program displays text (and only the text) that corresponds to the task conditions. By the way, you need to get used to this. Junior developers' special ability to create unnecessary code is pretty annoying to senior developers.
8
tugas
Java Core,  tingkatwulangan
Dikunci
OOP: Method overloading
Let's display matrices in different ways, however we want. OOP gives us a wonderful tool for this: method overloading. Overload the printMatrix method in 8 different ways. You should end up with 10 different printMatrix methods.
4
tugas
Java Core,  tingkatwulangan
Dikunci
OOP: Method overloading - Eliminating the superfluous
Not every overloaded method is useful. And so it is in this program. Look at the code and think about which implementation of the print method will be called. Then remove all the superfluous implementations of the method - and you're done.
4
tugas
Java Core,  tingkatwulangan
Dikunci
Man or woman?
Something in this program isn't right... It seems to display the names of men, but not those of women. Put an end to the discrimination: change the printName method so that it runs for both man and woman. The method should have a single implementation.
4
tugas
Java Core,  tingkatwulangan
Dikunci
Be gone, all that is unnecessary!
Again, we have extra lines in a program. They've resulted in a bug, because the program tries to call the add method for cases for which it is not implemented. We won't override the superfluous add methods this time. We'll do something simpler: delete the lines for which there is no implementation.
Komentar
  • Popular
  • Anyar
  • lawas
Sampeyan kudu mlebu kanggo ninggalake komentar
Kaca iki durung duwe komentar