How many times is the Location property on the newly created Match class assigned?

You are developing an application that tracks tennis matches. A match is represented by the
following class:

A match is created by using the following code:

How many times is the Location property on the newly created Match class assigned?

You are developing an application that tracks tennis matches. A match is represented by the
following class:

A match is created by using the following code:

How many times is the Location property on the newly created Match class assigned?

A.
0

B.
1

C.
2

D.
3



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Paul

Paul

Can someone explain why the answer is two?

Christian Zalto

Christian Zalto

The first time is when the match is instantiated in “Dim match = New Match”.
Location is initially still “unknown”.

The second time in the With statement when location is set to “north region”.

Paul

Paul

Well, that makes sense. Thanks.

DB7

DB7

First time upon instantiation of the class (within the constructor), then upon assignment of the property.