Learn About Upgrade: MCAD Skills to MCTS Windows Applications

These questions are based on 70-553VB: Upgrade: MCAD Skills to MCTS Windows Applications by Using the Microsoft .NET Framework (VB.NET)

A Self Test Software Practice Test

Objective: Develop applications that use system types and collections.
Sub-objective: Manage a group of associated data in a .NET Framework application by using collections (Refer System.Collections namespace).

Single answer, multiple-choice

You are an application developer for your company. You are creating an application that uses a Queue class object named MyQueue to store messages sent by the user during application run time.

Before processing the user messages, you want to access the message at the beginning of the queue without removing it. Which method of the MyQueue object should you use?

A.    Peek.
B.    Dequeue.
C.    Enqueue.
D.    Contains.

Answer:
A

Tutorial:
You should use the Peek method to access the message that is stored at the beginning of the MyQueue object. The Peek method accesses the element stored at the beginning of the object of the Queue class without removing the element from the queue. The Queue class is a data structure for handling elements based on the First In First Out (FIFO) concept. According to the FIFO concept, elements that are stored first are processed first.

You should not use the Dequeue method of the Queue class because this method is used to remove the next element at the beginning of a Queue object. In this scenario, you want to access the next element at the beginning…


cmadmin

ABOUT THE AUTHOR

Posted in Uncategorized|

Comment:

Powered by WebDesk