+ 1

How to define a property in a class of another class type in c#?

I want to define a property in a class of type another class. for example I have a classA with some properties and I want to declare another class that have a property of type classA.

26th Jun 2018, 4:56 PM
sajede mirzaei
sajede mirzaei - avatar
4 odpowiedzi
+ 3
Passing an object to another https://code.sololearn.com/c6Iga31L2BS5/#cs Inheriting static property https://code.sololearn.com/c52xKD9q6gPB/#cs Just a couple of ideas
26th Jun 2018, 10:38 PM
ODLNT
ODLNT - avatar
+ 1
class classB { public classA var; }
26th Jun 2018, 6:31 PM
TurtleShell
TurtleShell - avatar
0
I wrote it like this before but when I want to initialize properties of var, it doesn't work and var is undefined
26th Jun 2018, 7:38 PM
sajede mirzaei
sajede mirzaei - avatar
0
classA. classA CA1 = new class
8th Jul 2018, 1:41 AM
Jungle Lord
Jungle Lord - avatar