CodeGym/Java Course/मॉड्यूल 2: जावा कोर/स्तर के लिए अतिरिक्त पाठ

स्तर के लिए अतिरिक्त पाठ

उपलब्ध

जावा में जेनरिक क्या हैं?

इस पाठ में हम जेनरिक के बारे में बात करते हैं। या यों कहें, उन मूल बातों के बारे में जिन्हें आपको जेनरिक में प्रवेश करते समय जानने की आवश्यकता है: जेनरिक क्या हैं और आपको उनकी आवश्यकता क्यों है। विषय बहुत महत्वपूर्ण है, और आपको इसे निश्चित रूप से समझने की आवश्यकता है। आगे!

बिल्लियों के लिए जेनरिक

टाइप सुरक्षा और लचीलेपन के लिए डेवलपर्स को कंपाइलर को अतिरिक्त जानकारी देने में मदद करने के लिए जेनरिक एक बेहतरीन टूल है। CodeGym समुदाय के एक सदस्य द्वारा लिखा गया यह विस्तृत लेख "जेनेरिक" के बारे में एक और जानकारी देता है।

विलोपन टाइप करें

यह पाठ जेनरिक की कुछ विशेषताओं के साथ-साथ उनके साथ काम करते समय उत्पन्न होने वाली कमियों के लिए समर्पित है। क्योंकि जब भाषा बनाई गई थी तब जेनरिक जावा का हिस्सा नहीं थे, टाइप इरेज़र जोड़ा गया है। वह क्या है? हम यह पता लगा लेंगे।

जेनरिक में वाइल्डकार्ड

वाइल्डकार्ड जेनरिक की एक बहुत ही महत्वपूर्ण विशेषता है और निश्चित रूप से एक अलग पाठ के लायक हैं । यह एक रोचक और सरल विषय है। आप इसे प्यार करने जा रहे हैं :)

जेनरिक के साथ काम करते समय varargs का उपयोग करना

जेनरिक के साथ varargs का उपयोग करने से अप्रिय परिणाम हो सकते हैं - ढेर प्रदूषण। इस पाठ में , हम जावा में जेनरिक की विभिन्न विशेषताओं की चर्चा समाप्त करते हैं।

4
टास्क
Java Core,  स्तर 5सबक 4
लॉक
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
टास्क
Java Core,  स्तर 5सबक 4
लॉक
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
टास्क
Java Core,  स्तर 5सबक 4
लॉक
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
टास्क
Java Core,  स्तर 5सबक 4
लॉक
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
टास्क
Java Core,  स्तर 5सबक 4
लॉक
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.
टिप्पणियां
  • लोकप्रिय
  • नया
  • पुराना
टिप्पणी लिखने के लिए आपको साइन इन करना होगा
इस पेज पर अभी तक कोई टिप्पणियां नहीं हैं