Q:
What is difference between methods and blocks?
Answer
Method contains name, parameters, return type and executable body. But block does not contains name, parameters, return type.It contains only executable body.
Methods are executed by method call statements. Blocks are executed automatically with class loading and with object creation.
View answer
Workspace
Report Error
Discuss