What are the differences between constructor and method of a class in Java?