public Alphabet(params char[] list)
{
this.ExceptionInitializer();
try
{
if (list != null) _alphabet = list;
else throw this.NullableAssignment; //add exception handler;
this._charCounter = list.Length;
}
catch (this.NullableAssignment)
{
// var x = new Alphabet();
// this = x; //FAIL!
}
}
public Alphabet(params char[] list) { this.ExceptionInitializer(); try { if (list != null) _alphabet =
Share
You can’t do this – the closest thing would be to create a static factory method which returns an
Alphabet:Although given your example, even simpler would just be to assign an empty array in the place of null: