Answers for "c# new keyword"

C#
0

c# new keyword

The new operator creates a new instance of a type.
  
In the example below an object is created for the class using the new.
   Calculate c = new Calculate();

You can also use the new keyword to create an instance of the array.
  double[] points = new double[10];

The new keyword is also used to create object of a collection.
  SortedList sl = new SortedList(); // SortedList
  List<string> myList = new List<string>() // List
Posted by: Guest on November-25-2020

C# Answers by Framework

Browse Popular Code Answers by Language