Question: what is difference between class and method in java?
Answer: In Java, a class is defined as a set of coded instructions for creating an object. The object can be nearly anything that can exist in a program. A method, on the other hand, is a code construct that gives instructions or asks a question of the program.