{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "f6da257f-cb8d-4581-ad1d-7a51eca57ff4",
   "metadata": {},
   "source": "# Preview Questions\n\nComplete these questions **before** class to prepare for the chapter.\nUse the dropdowns to check your answers.\n"
  },
  {
   "cell_type": "markdown",
   "id": "6df3c08c-ac10-4aa7-9e4c-8f7f37c5528e",
   "metadata": {},
   "source": "## True or False\n\n**1.** In C#, a class can inherit from multiple classes simultaneously.\n\n```{dropdown} Answer\n**False** — C# supports single-class inheritance only; multiple interfaces are allowed.\n```\n\n**2.** `private` members of a class are accessible only within that class.\n\n```{dropdown} Answer\n**True** — `private` is the most restrictive access modifier.\n```\n\n**3.** Method overriding in a derived class requires the `override` keyword.\n\n```{dropdown} Answer\n**True** — The base method must be `virtual` and the derived method uses `override`.\n```\n\n**4.** An abstract class can be instantiated directly with `new`.\n\n```{dropdown} Answer\n**False** — Abstract classes cannot be instantiated; you must use a concrete subclass.\n```\n\n**5.** Polymorphism allows a derived class object to be used as its base class type.\n\n```{dropdown} Answer\n**True** — This is the Liskov Substitution Principle in practice.\n```\n\n"
  },
  {
   "cell_type": "markdown",
   "id": "2440a62d-8a57-43b1-aeb6-093c93af689b",
   "metadata": {},
   "source": "## Multiple Choice\n\n**1.** Which access modifier restricts a member to the declaring class only?\n\na) public  \nb) protected  \nc) private  \nd) internal\n\n```{dropdown} Answer\n**c) private** — `private` members are invisible outside the class.\n```\n\n**2.** In C#, which syntax indicates that a class inherits from another?\n\na) implements BaseClass  \nb) extends BaseClass  \nc) : BaseClass  \nd) inherits BaseClass\n\n```{dropdown} Answer\n**c) : BaseClass** — C# uses `:` for both inheritance and interface implementation.\n```\n\n**3.** Which OOP principle bundles data with methods and restricts direct field access?\n\na) Abstraction  \nb) Inheritance  \nc) Encapsulation  \nd) Polymorphism\n\n```{dropdown} Answer\n**c) Encapsulation** — Encapsulation keeps fields private and exposes behavior through methods.\n```\n\n**4.** To enable method overriding in the derived class, the base method must be marked:\n\na) abstract  \nb) virtual  \nc) override  \nd) sealed\n\n```{dropdown} Answer\n**b) virtual** — `virtual` allows a derived class to override the method with `override`.\n```\n\n**5.** An `interface` in C# defines:\n\na) A complete implementation with code  \nb) A contract of method and property signatures  \nc) A singleton class  \nd) A static utility class\n\n```{dropdown} Answer\n**b) A contract of method and property signatures** — Interfaces declare what a class must do, not how it does it.\n```\n\n"
  },
  {
   "cell_type": "markdown",
   "id": "f021174e-ea14-407a-8d59-c76550ebe32c",
   "metadata": {},
   "source": "```{rubric} Footnotes\n```\n"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".NET (C#)",
   "language": "C#",
   "name": ".net-csharp"
  },
  "language_info": {
   "name": "csharp"
  },
  "polyglot_notebook": {
   "kernelInfo": {
    "defaultKernelName": "csharp",
    "items": [
     {
      "aliases": [],
      "name": "csharp"
     }
    ]
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
