In what way is static initialisation of data type different from dynamic initialisation?
Advertisements
Question
In what way is static initialisation of data type different from dynamic initialisation?
Answer in Brief
Advertisements
Solution
- 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
Is there an error in this question or solution?
Chapter 1.03: Values and Data Types - EXERCISES [Page 33]
