Which code segment should you use?

You are creating an application that manages information about your company’s products.
The application includes a class named Product and a method named Save.

The Save() method must be strongly typed. It must allow only types inherited from the
Product class that use a constructor that accepts no parameters.
You need to implement the Save() method.
Which code segment should you use?

You are creating an application that manages information about your company’s products.
The application includes a class named Product and a method named Save.

The Save() method must be strongly typed. It must allow only types inherited from the
Product class that use a constructor that accepts no parameters.
You need to implement the Save() method.
Which code segment should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 3

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


PaulC

PaulC

D is correct

there is condition Product to ensure the type will be of a Product class
condition new() ensures the empty/default constructor and must the last condition

ASV

ASV

13 and 47 almost the same.

ASV

ASV

47 and 72 are the same.