Home » Interview » Technology

What is difference between methods and blocks?

Correct Answer: Method contains name, parameters, return type and executable body But block does not contains name, parameters, return typeIt contains only executable body Methods are executed by method call statements Blocks are executed automatically with class loading and with object creation

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion