Computer Science, asked by divyanshi261, 1 year ago

difference between static declaration and dynamic initialization

Answers

Answered by prince1233
18
static method.. It is a method which belongs to the class and notto the object(instance). A static method can access only static data. It can not access non-static data (instance variables). A static method can call only other static methods and can not call a non-static method from it. A static method can be accessed directly by the class name and doesn’t need any object.

Syntax : <class-name>.<method-name>

A static method cannot refer to "this" or "super" keywords in anyway.

and. dynamic method
Java allows its programmers to initialize a variable at run time also. Initializing a variable at run time is called dynamic initialization. The code below (DynamicInitializationDemo.java) demonstrates it.
Answered by shailendrahdi1982
1

Answer:

give some more point in ststic and dynamic Instagram

Similar questions