Question: Which code snippet correctly declares a variable named userId with a public `get` and private `set`?

  1. `public int userID ;`
  2. `public int userID [get, private set];`
  3. `public int userID { get; private set; }`
  4. `public int userID = { public get, private set };`

Answer: The correct answer of the above question is Option C:`public int userID { get; private set; }`