Answer the question
In order to leave comments, you need to log in
How are the records for creating a class object different?
class A
{
public int X { get; set; }
public int Y { get; set; }
public A(int x, int y)
{
X = x;
Y = y;
}
public void test() { }
}
Answer the question
In order to leave comments, you need to log in
A a2
- this is nothing, you just described the signature of the variable, consider just a violin case. Until you have created an object (violin) via new
, which you put in the case, you cannot do anything with the case. You can't play the violin a2.X = 1;
if you don't have one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question