Which of the following is a correct way to declare an indexer in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
public int this[int index] { get { return array[index]; } set { array[index] = value; } }
Answer option 2
public int this[int index] = { get { return array[index]; } set { array[index] = value; } }
Answer option 3
public int this[int index] => { get { return array[index]; } set { array[index] = value; } }
English