+ 1

What is <the_class_name>() during instantiation of an object?

For example, if a create a: class Person { int age; string name; public void SayHi() { Console.WriteLine("Hi"); } } static void Main(string[] args) { Person p1 = new Person(); p1.SayHi(); } What is Person() while instantiating the object?

17th Sep 2020, 5:12 AM
Rohan Agarwal
Rohan Agarwal - avatar
1 Resposta
+ 4
Constructor
17th Sep 2020, 5:16 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar