ClassQuiz.md - brainchildservices/curriculum GitHub Wiki

  1. What is a class?

    • A class is a user-defined blueprint or prototype from which objects are created.
  2. What is an object?

    • Object is an entity that has state and behavior. Here, state means data and behavior means functionality. Object is a runtime entity, it is created at runtime.
  3. Define syntax of class declaration.

    • Accessibility Modifiers class NameofClass { body of class containing data members and member functions }
  4. Define instantiation.

    • When you create a new object in C# for a class using the new keyword, then it is called instantiation.
  5. Define syntax of object creation.

    • ClassName objectName = new ClassName();
  6. What do you have to do if you are asked to create an instance of a class or object of a class or instantiate the class?

    • We need to create an object of the class using the new keyword if we are asked to create instance of a class or object of a class or instantiate the class Classname objectName=new ClassName();
  7. Does we can create when the class is static?

    • No,An object cannot be created when the class is static. Members of the static classes are accessed using the classname.