You develop a Windows-based application that contains a form named ContactABC. You need to write code to initialize all class-level variables in ContactABC as soon as ContactABC is instantiated. You will place your code in a public procedure in the ContactABC class. Which public procedure should you use?

  1. Create

  2. Initialize

  3. Load

  4. New


Correct Option: D

AI Explanation

To answer this question, you need to understand the purpose of each public procedure in the ContactABC class. Let's go through each option to understand why it is correct or incorrect:

Option A) Create - This option is incorrect because the "Create" procedure is not a valid public procedure in the ContactABC class.

Option B) Initialize - This option is incorrect because the "Initialize" procedure is not a valid public procedure in the ContactABC class.

Option C) Load - This option is incorrect because the "Load" procedure is typically used to load data or perform initialization tasks when a form is loaded, not when the ContactABC class is instantiated.

Option D) New - This option is correct because the "New" procedure is a valid public procedure in the ContactABC class. It is called when a new instance of the ContactABC class is created, allowing you to initialize class-level variables at that time.

The correct answer is D) New. This option is correct because it allows you to initialize all class-level variables in ContactABC as soon as it is instantiated.

Find more quizzes: