How are method parameters initialized in Java?
Advertisements
प्रश्न
How are method parameters initialized in Java?
लघु उत्तर
Advertisements
उत्तर
- In Java, method parameters are initialized automatically with the values of the arguments passed to the method when it is called. These values are assigned to the corresponding parameters in the order in which they are declared.
- Method parameters act as local variables and receive their initial values during the method call. Unlike instance and static variables, method parameters do not receive default values.
Thus, method parameters are initialized through the arguments supplied by the calling method.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
