Python Unit 11

  1. When you instantiate an object, the automatically created method that i called is a(n) _________.




    B. constructor
  2. Every class has ______.




    B. at least one constructor
  3. Which of the following can be overloaded?




    C. both of the above
  4. Every default constructor ______.




    D. requires no parameter
  5. When you write a constructor that receives a parameter, ______.




    B. it becomes the default constructor
  6. When you write a constructor that receives no parameters, ________.




    C. both of the above
  7. Most often, a destructor is called when _______.




    B. an object goes out of scope
  8. Which of the following is not a similarity between constructors and destructors?




    D. Both can be overloaded.
  9. Which of the following is not an advantage of creating a class that inherits from another class?




    A. You save time because subclasses are created automatically from those that come built in as part of a programming language.
  10. Employing inheritance reduces errors because _______.




    D. many of the methods you need have already been used and tested
  11. A class that is used as a basis for inheritance is called a ____.




    D. subclass
  12. Which of the following is another name for a derived class?




    D. child class
  13. Which of the following is not another name for a derived class?




    B. subclass
  14. Which of the following is true?




    A. A child class can also be a parent class.
  15. A derived class inherits ________ data and methods of its ancestors.




    D. all
  16. Which of the following is true?




    A. A class's methods usually are public.
  17. A _________ is a collection of predefined, built-in classes that you can use when writing programs.




    B. library
  18. An environment in which you can develop GUI programs by dragging components to their desired positions is a(n) _______.




    D. visual development environment
  19. In object-oriented programs, errors are known as _____.




    C. exceptions
  20. The general principle of exception handling in object-oriented programming is that a method that uses data should ______.




    B. be able to detect errors, but not required to handle them
Author
jdavis123
ID
358628
Card Set
Python Unit 11
Description
Updated