Question: Which code snippet correctly declares a variable named userId with a public `get` and private `set`?
- `public int userID
;` - `public int userID [get, private set];`
- `public int userID { get; private set; }`
- `public int userID = { public get, private set };`
Answer: The correct answer of the above question is Option C:`public int userID { get; private set; }`