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 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 Why this is the answer A property can validate, compute or restrict access while keeping the calling syntax simple. Question 2 of 9 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 Why this is the answer The compiler creates a private field and the get and set bodies for you. Question 3 of 9 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 Why this is the answer init accessors make a property settable in an object initialiser or constructor, then immutable. Question 4 of 9 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 Why this is the answer The constructor runs on creation and is the place to validate and assign required state. Question 5 of 9 Question 5 of 9 Which keyword prevents a class from being inherited? A static B sealed C readonly D const Why this is the answer sealed stops inheritance. Sealing a class is a commitment that its behaviour will not be extended. Question 6 of 9 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 Why this is the answer C# requires the base method to be virtual, abstract or override, and the derived method to use override. Question 7 of 9 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 Why this is the answer An interface declaration is a contract; implementing classes must supply the member unless a default implementation exists. Question 8 of 9 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 Why this is the answer Records generate value-based equality, a readable ToString and non-destructive mutation through with. Question 9 of 9 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 Why this is the answer 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