Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

one question about method and static method

Former Member
0 Likes
523

If all the variables in a method are global variables/class-data/constants and no importing parameter.

What's the difference between it is defined as a static method or a normal one?

2 REPLIES 2
Read only

rajkumarnarasimman
Active Contributor
0 Likes
496

Hi Ming Yu,

For this case, we won't find any difference in static method and normal(Instance) method based on variable.

But basic difference in calling the method.

Static Method

To call static method, it is not required to create the object for the class. Also static method won't support polymorphism.

CLASS1=>METHOD1.

Instance Method

To call normal method(Instance), It is required to have the object for the class.

OBJ->METHOD1.

Regards

Rajkumar Narasimman

Read only

matt
Active Contributor
0 Likes
496

You can't override a static method.