+ 1

Java is dynamic program..but y we r using static functuon in programs?

7th Nov 2016, 9:09 PM
Shaik Usman
Shaik Usman - avatar
2 ответов
- 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
13th Dec 2016, 12:24 AM
Shubham Rana
Shubham Rana - avatar
+ 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".
7th Nov 2016, 10:56 PM
Pierre Varlez
Pierre Varlez - avatar