¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
Difference between properties and constructors
Explain the difference between properties and constructors in the class discussion to me with a simple example.
3 Respuestas
+ 2
safir safir1
Have you tried to using searchbar 🔎?
See this what I found after searching...
https://stackoverflow.com/questions/18106594/difference-between-constructor-and-properties-in-c-sharp#:~:text=Constructors%20have%20the%20same%20name,the%20behavior%20for%20the%20class.
+ 1
They are completely different things and serve different tasks. Why do you think they are similar?
0
(constructor and property in context to C# ) since both of them used to initialized your class fields