[Solved] Is there a way to add two numbers using a private constructor in C#

[ad_1]

Here’s an example:

public class Example {
    public int Result {get; private set;}
    private Example(int x, int y){
       Result = x + y;
    }
    public static Example Create(int x, int y){
         return new Example(x,y);
    }   
}

[ad_2]

solved Is there a way to add two numbers using a private constructor in C#