Difference between properties and constructors | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Difference between properties and constructors

Explain the difference between properties and constructors in the class discussion to me with a simple example.

20th Aug 2023, 11:37 AM
safir safir1
safir safir1 - avatar
3 Respostas
+ 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.
20th Aug 2023, 11:46 AM
Darpan kesharwanišŸ‡®šŸ‡³[InactivešŸ“š]
Darpan kesharwanišŸ‡®šŸ‡³[InactivešŸ“š] - avatar
+ 1
They are completely different things and serve different tasks. Why do you think they are similar?
20th Aug 2023, 3:52 PM
Š•Š²Š³ŠµŠ½ŠøŠ¹
Š•Š²Š³ŠµŠ½ŠøŠ¹ - avatar
0
(constructor and property in context to C# ) since both of them used to initialized your class fields
20th Aug 2023, 11:56 PM
safir safir1
safir safir1 - avatar