Calling class as a function is possible or not in any of programming language. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Calling class as a function is possible or not in any of programming language.

22nd Mar 2019, 7:06 AM
Pratik Mohite
Pratik Mohite - avatar
5 Answers
+ 4
Well, if seems you have misunderstood the concept of classes. Classes are used to encapsulate relative data. We cannot call Class just as we do with function. But yes if there is a function inside a class, then you can surely call that function, but not class.
22nd Mar 2019, 7:10 AM
Letsintegreat
Letsintegreat - avatar
+ 4
Pratik Mohite No it is not possible. There's no such thing like "calling a class", we generally call the "constructor" of the class to create an instance but we do not call the class.
22nd Mar 2019, 7:19 AM
Letsintegreat
Letsintegreat - avatar
+ 3
Pratik Mohite check mark my answer if that helped you😊
22nd Mar 2019, 9:00 AM
Letsintegreat
Letsintegreat - avatar
+ 1
I know about concept of classes but one of my friend say it is posible in c#
22nd Mar 2019, 7:15 AM
Pratik Mohite
Pratik Mohite - avatar
+ 1
Ok
22nd Mar 2019, 8:45 AM
Pratik Mohite
Pratik Mohite - avatar