public class Report
{
public static int A = B + 2;
public static int B = A + 2;
}
AFAIK, in a class it executes the fields in the order of their presence in the class. Referring the first time to Report
class, the fields will be initialized as A = 2
and B = 4
But what is the order in partial classes?
public partial class Report
{
public static int A = B + 2;
}
public partial class Report
{
public static int B = A + 2;
}
Maybe if the classes are in the same file, it still executes in the order of presence in the file. Or what?
But/And what is the order if the partial classes are in different files?
By the way, I am asking this out of curiosity.