Question from the C# - Fundamentals test

Write a C# class with a private int age field and getter and setter methods for it.

Easy

What are the correct syntaxes to access (read and/or write) a private int age field of a class:

Author: MaximeStatus: PublishedQuestion passed 640 times
Edit
0
Community Evaluations
developer avatar
Ambiguous
Alain
27/11/2023
Vous ĂȘtes en train de dĂ©crire une façon de dĂ©clarer une propriĂ©tĂ© pas un accĂšs Ă  une variable privĂ©e!
developer avatar
Auteur anonyme
13/12/2023
Bonjour Alain, Merci pour ton commentaire, c'est juste mais la seule maniÚre d'accéder à la variable privée `age` c'est en déclarant une interface publique `Age`