C# new operator

new operator creates a new object.

class human
{
public int age;
public string sex;
public human(int a, string s) {age=a;sex=s;}
}
human sophia = new human(22,"female");

new operator creates a new delegate.
delegate void f(int i);
f dg = new f(8);

new operator creates a new array.
int[] arr = new int[4];



endmemo.com © 2024  | Terms of Use | Privacy | Home