+ 1
Java is dynamic program..but y we r using static functuon in programs?
2 Answers
- 1
Java allocates memory for defined objects in the program dynamically at run time.....and static is a Java keyword, which is used to declare variables and methods
+ 6
What do you mean by "dynamic program" ?
The "static" keyword is used to represent functions / variables that belong to the class rather than the instanciated object, which means you call them not through an object but through the class name.
By example, if you do math and you want to access the Pi constant, you don't need to create an object of type Math, you can access it directly through the class as it is static, using "Math.PI".