exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 39 discussion

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

DRAG DROP -
You are developing a C# console application that outputs information to the screen. The following code segments implement the two classes responsible for making calls to the Console object:

When the application is run, the console output must be the following text:

Log started -

Base: Log continuing -

Finished -
You need to ensure that the application outputs the correct text.
Which four lines of code should you use in sequence? (To answer, move the appropriate classes from the list of classes to the answer area and arrange them in the correct order.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Note:
✑ The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class.
✑ An abstract class cannot be instantiated. The purpose of an abstract class is to provide a common definition of a base class that multiple derived classes can share.

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
Andrei
Highly Voted 5 years, 10 months ago
6,5,1,4
upvoted 28 times
...
asdf652434
Highly Voted 5 years, 9 months ago
To get the output: Log started Base: Log continuing Finished you need BaseLogger logger = new Logger(); logger.Log("Log started"); logger.Log("Base: Log continuing"); ((Logger)logger).LogCompleted();
upvoted 21 times
asdf652434
5 years, 9 months ago
"new" hides the implementation of the base class but it also means you need a "Logger" reference to access the "Logger" implementation
upvoted 8 times
...
...
DaGrooveNL
Most Recent 4 years, 5 months ago
FINAL ANSWER: 6. BaseLogger logger = new Logger(); 5. logger.Log("Log started"); 1. logger.Log("Base: Log continuing"); 4. ((Logger)logger).LogCompleted();
upvoted 1 times
...
HgstExam
4 years, 9 months ago
Anwser is wrong, confirmed the following: BaseLogger logger = new Logger(); logger.Log("Log Started"); //always uses Logger logger.Log("Base: Log Continuing"); //cannot use BaseLogger (virtual) ((Logger)logger).LogCompleted(); //need to cast to use Logger (new)
upvoted 7 times
JorgeGris
4 years, 6 months ago
Tested: https://dotnetfiddle.net/QVGQSp
upvoted 1 times
...
...
thiemamd
4 years, 11 months ago
Tested! //6 5 1 4 BaseLogger logger = new Logger(); logger.Log("Log Started"); logger.Log("Base: Log Continuing"); ((Logger)logger).LogCompleted();
upvoted 3 times
...
majco333
5 years, 7 months ago
6,5,2,4 I try it: BaseLogger logger = new Logger(); logger.Log("Log started"); ((BaseLogger)logger).Log("Log continuing"); ((Logger)logger).LogCompleted();
upvoted 2 times
majco333
5 years, 6 months ago
It's bad. Tested: BaseLogger logger = new Logger(); logger.Log("Log started"); logger.Log("Base: Log continuing"); ((Logger)logger).LogCompleted();
upvoted 2 times
majco333
5 years, 6 months ago
Sorry for spam. Definitely correct is: BaseLogger logger = new Logger(); logger.Log("Log started"); logger.Log("Base: Log continuing"); ((Logger)logger).LogCompleted();
upvoted 6 times
...
...
...
IF_Elias
5 years, 10 months ago
6,5,1,4 the answer
upvoted 7 times
...
supersunny
5 years, 11 months ago
6,5,1,7
upvoted 5 times
Codenoob
4 years, 10 months ago
Replace 7 with 4. ((Logger)logger).LogCompleted() is the correct implementation. I just tested it now.
upvoted 5 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 ...