+ 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.
4 Réponses
+ 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
+ 1
class classB {
public classA var;
}
0
I wrote it like this before but when I want to initialize properties of var, it doesn't work and var is undefined
0
classA.
classA CA1 = new class