I read that functions is used to run a block of code again and again
class is group of similar kind of functions which can be understood by an analogy that function can be considered as Plumber and class can be considered as Household repair which contains multiple functions like carpenter , electrician , plumber and so on..
But i also read that class is like a template from which , a large number of objects can be made for which i read the analogy of a examination in which the answer sheets have a particular template for student to write which can be considered as class and each student enters different solutions to the question paper , so each student in a way created an object from the class template .
So how both the definitions of class are related to one another.
I expect the relation between the two definitions with an analogy (if possible)
Thank You
Pragun Sharma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.