I've been learning design patterns and I saw such a method call from a class :
class Client: SubjectAccessor {
static void Main() {
Console.WriteLine("Proxy Pattern\n");
ISubject subject = new Proxy();
Console.WriteLine(subject.Requesy());
subject = new(); //Here is what I am asking
COnsole.WriteLine(subject.Request());
}
}
As you can see there is a subject = new();
call there and I am wondering whether it is creating a new instance of Proxy
or something else. I've not found anything related to this.
Your help is much appreciated.
If you need, I can paste the whole code or actually it is written on a book so I need to write it down here.
Thanks.
It is a typo in the book. There is no current version of C# in which that is valid (it should raise a "Type expected" compiler error). Without context it is impossible to know what it should be.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With