-6

i am always use static keyword but don't know clearly what is main purpose of static keyword. can any define , this is use in java Display method in oop

mega6382
  • 9,211
  • 17
  • 48
  • 69

1 Answers1

2

Static methods are those methods can be called without creating its object. It can be invoked using its class name.

Eg. Math.sqrt(25);

Where Math is the class name, not an object and static methods can access only static properties of the class.