Advertisements
Advertisements
प्रश्न
In what way is static initialisation of data type different from dynamic initialisation?
संक्षेप में उत्तर
उत्तर
- This method assigns a constant directly to a declared variable. When a variable is declared, it is initialised before being used in programming logic.
- Examples:
int a = 0;
float f = 0.0;
double d = 0.0;
- Examples:
- Dynamic initialisation refers to the process of setting a variable during program execution. In this scenario, a variable is allocated based on an arithmetic operation or logical function.
- Examples:
int a, b, c;
c = a + b;
String s1, s2, s3;
s3 = s1 + s2
- Examples:
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.03: Values and Data Types - EXERCISES [पृष्ठ ३३]