Give a difference between a constructor and a method.
5 Likes
Constructor has the same name as class name whereas function should have a different name than class name.
Answered By
4 Likes
Name the following:
(a) Method with the same name as of the class and is invoked every time an object is created.(b) Keyword to access the classes of a package.