Hi guys,
I am new to C# and a have a question around class instances.
I have a class, Pizza. To create an instance I would use:
Lets suppose I wanted to create a new instance of a pizza when a customer makes an order at runtime.
How can I create a Pizza instance at runtime without create the instances first (because i dont know how many pizzas would be ordered)?
Ideally i would like the instances the take a name I supply at runtime (e.g from a string)
I am new to C# and a have a question around class instances.
I have a class, Pizza. To create an instance I would use:
Code:
Pizza pizza1 = new Pizza("Cheese");
How can I create a Pizza instance at runtime without create the instances first (because i dont know how many pizzas would be ordered)?
Ideally i would like the instances the take a name I supply at runtime (e.g from a string)
Comment