Why this error is there? CS0021

Here’s the error : Assets/Scripts/DNA.cs(44,35): error CS0021: Cannot apply indexing with to an expression of type `method group’

And here is my code

using UnityEngine;
using System.Collections;

public class DNA 
{
	
	//generates random character
	char newChar()
	{
		float c = Mathf.Floor (Random.Range (63, 122));

		if (c == 63)
			c = 32;
		if (c == 64)
			c = 46;
		return (char)c;
	}

	//constructer
	int num;
	public DNA (int numA)
	{
		num = numA;
	}

	//genes array of character
	char[] genes1;
	public char[] genes()
	{
		
		float fitness = 0;
		for (int i = 0; i < num; i++) {
			genes1  *= newChar ();*
  •  }*
    
  •  return genes1;*
    
  • }*

  • //the phrase of the genes array*

  • public string genesPhrase()*

  • {*

  •  string Phrase = "";*
    
  •  for (int i2 = 0; i2 < num; i2++)* 
    
  •  {*
    
  •  	Phrase += genes [i2]; //Here is the error*
    
  •  }*
    
  •  return Phrase;*
    
  • }*
    }
    it makes completely no sense, I just use an array like another…
    it says that I can’t use [] on a method group. Help!

You forgot a pair of parentheses before the square brackets. This is the way I would write the code.

using UnityEngine;

public class DNA
{
    //fields
    int num;
    char[] genes;

    //constructer
    public DNA(int num)
    {
        this.num = num;
    }

    //generates random character
    char GetChar()
    {
        float c = Mathf.Floor(Random.Range(63, 122));

        if (c == 63)
            c = 32;
        if (c == 64)
            c = 46;
        return (char)c;
    }

    //genes array of character
    public char[] GetGenes()
    {
        for (int i = 0; i < num; i++)
        {
            genes *= GetChar();*

}
return genes;
}

//the phrase of the genes array
public string GetGenesPhrase()
{
string Phrase = “”;
for (int j = 0; j < num; j++)
{
Phrase += GetGenes()[j];
}
return Phrase;
}
}