Unity instantiate random prefab

//How to Instantiate difference prefab at runtime in Unity.

//Create a C# script and create a array

public GameObject[] prefeb;
//go in inspector in unity set size and drag the prefabs to the Element.
//create a function in same script and call it
void createdifobjects()
int prefeb_num = Random.Range(0, 3);
Instantiate(prefeb[prefeb_num], this.transform.position , this.transform.rotation);