Which four lines of code should you use in sequence?

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:


microsoft-exams

4 thoughts on “Which four lines of code should you use in sequence?

  1. BaseLogger logger = new Logger();
    logger.Log(“Log started”);
    logger.Log(“Base : Log continuing”);
    ((Logger)logger).LogCompleted();

  2. Correct Answer is

    BaseLogger logger = new Logger();
    logger.Log(“Log started”);
    logger.Log(“Base : Log continuing”);
    ((Logger)logger).LogCompleted();

  3. logger.LogCompleted() is incorrect as to have access to “new” method you need to have cast the logger to Logger and then invoke the LogCompleted method

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.