Multiple choice technology programming languages

Identify the correct syntax for instantiating a class .

  1. testObj = CTest

  2. testObj = CTest()

  3. CTest testObj = CTest()

  4. testObj = new CTest()

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Python, a class is instantiated by calling the class name as if it were a function, e.g., testObj = CTest(). Option 621437 does not instantiate it but assigns the class reference. Options 621439 and 621440 use static typing or new keywords from other languages.