Here is a program example to show how to declare an array of an object and use of array of an object.