HomeCode HereC# objects quiz C# objects quiz Admin 1 min read Updated November 16, 2026 Nine questions on classes, constructors, properties, inheritance and interfaces. C# C# objects quiz 9 questions, instant feedback Question 1 of 9 What does a property add over a public field? A Faster access B Logic and validation around get and set C Nothing D Memory savings A property can validate, compute or restrict access while keeping the calling syntax simple. Question 2 of 9 What does an auto-property { get; set; } generate? A A method only B A hidden backing field with accessors C A constant D An interface The compiler creates a private field and the get and set bodies for you. Question 3 of 9 What does init allow on a property? A Setting it only during construction B Setting it anywhere C Reading it once D Deleting it init accessors make a property settable in an object initialiser or constructor, then immutable. Question 4 of 9 What does a constructor do? A Destroys an object B Initialises a new object C Copies a class D Returns a value The constructor runs on creation and is the place to validate and assign required state. Question 5 of 9 Which keyword prevents a class from being inherited? A static B sealed C readonly D const sealed stops inheritance. Sealing a class is a commitment that its behaviour will not be extended. Question 6 of 9 What is required to override a method? A virtual on the base method and override on the derived one B Only override C Only virtual D new on both C# requires the base method to be virtual, abstract or override, and the derived method to use override. Question 7 of 9 What does an interface member without a body require? A Every implementing class to provide it B A default implementation C A virtual keyword D Nothing An interface declaration is a contract; implementing classes must supply the member unless a default implementation exists. Question 8 of 9 What does a record give you? A A mutable class with a constructor B Value equality, ToString and with-expressions C A database table D A static class Records generate value-based equality, a readable ToString and non-destructive mutation through with. Question 9 of 9 What does the override of ToString affect? A Equality B How the object prints and appears in debuggers C Sorting D Hashing ToString is used by string interpolation, Console.WriteLine and debuggers, which makes it worth writing. Check my answers Try again Your answers stay in this browser. Nothing is sent to a server. More quizzes C# basics quiz Coming soon C# control flow quiz 9 questions C# library quiz 9 questions All quizzes