Question: what is the difference between block and method in java?
Answer: A method is a block in the class scope that might accept a set of parameters and might produce a result through the return statement. Code blocks GENERALLY live inside methods (but not always, there are exceptions). Methods are also (generally) named and can be called from elsewhere in your code by that name.