Language
Version: 5
Categories
-
User Program Communication
-
Variables
-
Control Flow
-
Object Oriented Programming
-
Strings
Object Oriented Programming
Instantiation in C#
Instantiation is used to create an object from a class (instantiate).
Syntax
objectName = new className(parameters);
Notes
Input requirements are taken from the constructor. A class can have multiple constructors with different numbers of input parameters and types, to create different objects.
An instance of a class is called an object.
Example
myCar = new Car ("Honda");