What is the difference between Static Block and Static Method?

Showing Answers 1 - 2 of 2 Answers

SATCH

  • Sep 7th, 2007
 

A STATIC block is automatically executed the first time the class where it is defined is called. A Static Method is excuted only when a static call is made to this method.

  Was this answer useful?  Yes

Ariti

  • Sep 24th, 2007
 

Static block always executed immaterial of any thing so you can apply it for keep tracking of user visits.Static methods are always executed only by calling it through class name

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions