exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 11 discussion

Actual exam question from Microsoft's 70-483
Question #: 11
Topic #: 1
[All 70-483 Questions]

You are creating an application that manages information about zoo animals. The application includes a class named Animal and a method named Save.
The Save() method must be strongly typed. It must allow only types inherited from the Animal class that uses 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
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
When you define a generic class, you can apply restrictions to the kinds of types that client code can use for type arguments when it instantiates your class. If client code tries to instantiate your class by using a type that is not allowed by a constraint, the result is a compile-time error. These restrictions are called constraints. Constraints are specified by using the where contextual keyword.
References: http://msdn.microsoft.com/en-us/library/d5x73970.aspx

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
zzMichielzz
4 years, 8 months ago
C. Animal and New(). New() must be at last indeed.
upvoted 1 times
...
rucelee1234
4 years, 10 months ago
C is the answer
upvoted 1 times
...
lh2607
4 years, 11 months ago
C is correct
upvoted 1 times
...
robinnirola
5 years, 1 month ago
Ans : C
upvoted 1 times
...
tanujgyan
5 years, 2 months ago
C is the right answer
upvoted 4 times
...
yeetyeetgabbadabba
5 years, 2 months ago
Why is A wrong?
upvoted 2 times
tanujgyan
5 years, 2 months ago
Because the format is incorrect after : you need to write the name of the class
upvoted 4 times
...
...
dominikeps
5 years, 3 months ago
whalla C is answer
upvoted 2 times
...
Ofer
5 years, 3 months ago
B is wrong, as new() must be last.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...