Python Classes and objects Book Back Questions & Answers

Unit 10 > Computer Science > Class 12 > Samacheer Kalvi - English Medium

    Choose the correct answer

  • 1. Which of the following are the key features of an Object Oriented Programming language?

    (a) Constructor and Classes

    (b) Constructor and Object

    (c) Classes and Objects

    (d) Constructor and Destructor

    Correct answer: (c) Classes and Objects

    View explanation


  • 2. Functions defined inside a class:

    (a) Functions

    (b) Module

    (c) Methods

    (d) section

    Correct answer: (c) Methods

    View explanation


  • 3. Class members are accessed through which operator?

    (a) &

    (b) .

    (c) #

    (d) %

    Correct answer: (b) .

    View explanation


  • 4. Which of the following method is automatically executed when an object is created?

    (a) _object_( )

    (b) _del( )_( )

    (c) _func_( )

    (d) _init_( )

    Correct answer: (d) _init_( )

    View explanation


  • 5. A private class variable is prefixed with

    (a) _

    (b) &&

    (c) ##

    (d) **

    Correct answer: (a) _

    View explanation


  • 6. Which of the following method is used as destructor?

    (a) _init_( )

    (b) _dest_ ( )

    (c) _rem_( )

    (d) _del_( )

    Correct answer: (d) _del_( )

    View explanation


  • 7. Which of the following class declaration is correct?

    (a) class class_name

    (b) class class_name< >

    (c) class class_name:

    (d) class class_name[ ]

    Correct answer: (c) class class_name:

    View explanation


  • 8. Which of the following is the output of the following program? class Student: def __init__(self, name): self.name=name print (self.name) S=Student(Tamil)

    (a) Error

    (b) Tamil

    (c) name

    Correct answer: (b) Tamil

    View explanation


  • 9. Which of the following is the private class variable?

    (a) _num

    (b) ##num

    (c) $$num

    (d) &&num

    Correct answer: (a) _num

    View explanation


  • 10. The process of creating an object is called as:

    (a) Constructor

    (b) Destructor

    (c) Initialize

    (d) Instantiation

    Correct answer: (d) Instantiation

    View explanation