Answers for "constructor vs static block"

-1

constructor vs static block

Constructor is used for creating object,
initializing instance and 
Execution depends on the object

I use it in pages classes in my framework

Static Block:
 used for initializing statics members,
it belongs to the class and only one copy
and runs only once and before everything

I use it in configuration.reader class
  in my framework
Posted by: Guest on January-05-2021

Browse Popular Code Answers by Language