Constructor Overloading in JAVA
Like method, Constructor can also be overloaded, Sometimes there is a need of initializing of an object in different ways this can be done using Constructor Overloading.
विधि की तरह, कन्स्ट्रक्टर को भी अधिभारित किया जा सकता है, कभी-कभी किसी ऑब्जेक्ट को अलग-अलग तरीके से शुरू करने की आवश्यकता होती है, यह कन्स्ट्रक्टर ओवरलोडिंग का उपयोग करके किया जा सकता है।
Constructor Overloading is a concept of having more than one constructor with different parameter list, in such a way so that each constructor can perform a different task.
कन्स्ट्रक्टर ओवरलोडिंग विभिन्न पैरामीटर सूची के साथ एक से अधिक कंस्ट्रक्टर होने की एक अवधारणा है, इस तरह से ताकि प्रत्येक कंस्ट्रक्टर एक अलग कार्य कर सके।
Constructor Overloading means same Constructor can be declare into the same class with the different parameter list.
कन्स्ट्रक्टर ओवरलोडिंग का अर्थ है एक ही कन्स्ट्रक्टर को अलग-अलग पैरामीटर सूची के साथ एक ही कक्षा में घोषित किया जा सकता है।
Compiler differentiate which constructor is to be called depending upon the number of parameters and their sequence of datatypes.
कंपाइलर अंतर करता है कि कौन से निर्माता को डेटा प्रकारों के मापदंडों और उनके अनुक्रम के आधार पर बुलाया जाना है।
2 Comments
Very helpful thank you so much for this Post
ReplyDeleteAwesome post
ReplyDeleteAgar aapko hindi punjnabi marathi tamil bhojpuri song ya singer pasand ha to niche diye hue link par jake unke koi bhi song ya kisi bhi song ko search krke unki lyrics dekh sakte ha
hindi song lyrics punjabi song lyrics english song lyrics new song lyrics