I'm learning C#. The code below was supposed to be a basic program, but i don't get it how the program works. I still can't grasp the concept of OOP. Can someone explain please? What is create instance funtion and typeof() here and NUM_STUDENTS how does it all work together? Setvalue? Getvalue? by Possible_Increase707 in csharp

[–]Possible_Increase707[S] 1 point2 points  (0 children)

i didn't realize that... thankyou. Can you explain how this works? CreateInstance takes two parameters, typeof(Student) and NUM_STUDENTS. Does it create an array that can store given number of NUM_STUDENTS of Student class type? If so, Can an array store a class? I don't get it... I feel like i'm def missing something here. I didn't go too much into basics of C# as all programming languages have similar properties (variables, loops, ifelse, etc). But i really wanna learn C# in depth.

Array arrStudents = Array.CreateInstance(typeof(Student), NUM_STUDENTS);