मराठी

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
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 6: Variables and Expressions - SHORT ASSIGNMENTS [पृष्ठ १३६]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
पाठ 6 Variables and Expressions
SHORT ASSIGNMENTS | Q 40. | पृष्ठ १३६
Advertisements
Share
Notifications



      Forgot password?
Use app×