1. Question: You write the following code. public delegate void FaxDocs(object sender, FaxArgs args);
    You need to create an event that will invoke FaxDocs. Which code segment should you use? (VB.Net)

    A
    Public Shared Event Fax As FaxDocs

    B
    Public Shared Event FaxDocs As Fax

    C
    Public Class FaxArgs
    Inherits EventArgs
    Private coverPageInfo As String
    Public Sub New(coverInfo As String)
    Me.coverPageInfo = coverPageInfo
    End Sub
    Public ReadOnly Property CoverPageInformation() As String
    Get
    Return Me.coverPageInfo
    End Get
    End Property
    End Class

    D
    Public Class FaxArgs
    Inherits EventArgs
    Private coverPageinfo As sting
    Public ReadOnly Property CoverPageInformation() As String
    Get
    Return Me.coverPageInfo
    End Get
    End Property
    End Class

    Note: Not available
    1. Report
  2. Question: You need to create a method to clear a Queue named q. Which code segment should you
    use? - (VB.Net)

    A
    For Each e As Object In q
    Dequeue()
    Next

    B
    For Each e As Object In q
    Enqueue(Nothing)
    Next

    C
    q.Clear()

    D
    q.Dequeue()

    Note: Not available
    1. Report
  3. Question: You are developing an application to assist the user in conducting electronic surveys. The
    survey consists of 25 true-or-false questions. You need to perform the following tasks: Initialize each
    answer to true. Minimize the amount of memory used by each survey. Which storage option should you
    choose? - (VB.Net)

    A
    BitVector32 answer = new BitVector32(1);

    B
    BitVector32 answer = new BitVector32(-1);

    C
    BitArray answer = new BitArray (1);

    D
    BitArray answer = new BitArray (-1);

    Note: Not available
    1. Report
  4. Question: You are creating an application that lists processes on remote computers. The application
    requires a method that performs the following tasks: Accept the remote computer name as a string
    parameter named strComputer. Return an ArrayList object that contains the names of all processes that
    are running on that computer. You need to write a code segment that retrieves the name of each process
    that is running on the remote computer and adds the name to the ArrayList object. Which code segment
    should you use? - (VB.Net)

    A
    Dim al As New ArrayList()
    Dim procs As array(Of process) = Process.GetProcessesByName(strComputer)
    For Each proc As Process In procs
    al.Add(proc)
    Next

    B
    Dim al As New ArrayList()
    Dim procs As array(Of process) = Process.GetProcesses(strComputer)
    For Each proc As Process In procs
    al.Add(proc)
    Next

    C
    Dim al As New ArrayList()
    Dim procs As array(Of Process) = Process.GetProcessesByName(strComputer)
    For Each proc As Process In procs
    al.Add(proc.ProcessName)
    Next

    D
    Dim al As New ArrayList()
    Dim procs As array(Of Process) = Process.GetProcesses(strComputer)
    For Each proc As Process In procs
    al.Add(proc.ProcessName)
    Next

    Note: Not available
    1. Report
  5. Question: You need to write a multicast delegate that accepts a DateTime argument. Which code
    segment should you use?

    A
    Public Delegate Function PowerDeviceOn(result As Boolean, autoPowerOff As DateTime) As
    Integer

    B
    Public Delegate Function PowerDeviceOn(sender As Object, autoPowerOff As EventArgs) As
    Boolean

    C
    Public Delegate Sub PowerDeviceOn(autoPowerOff As DateTime)

    D
    Public Delegate Function PowerDeviceOn(autoPowerOff As DateTime) As Boolean

    Note: Not available
    1. Report
  6. Question: You need to write a multicast delegate that accepts a DateTime argument and returns a
    Boolean value. Which code segment should you use? - (VB.Net)

    A
    Public Delegate Function PowerDeviceOn(ByVal result As Boolean, _
    ByVal autoPowerOff As DateTime) As Integer

    B
    Public Delegate Function PowerDeviceOn(ByVal sender As Object, _
    ByVal autoPowerOff As EventArgs) As Boolean

    C
    Public Delegate Sub PowerDeviceOn(ByVal autoPowerOff As DateTime)

    D
    Public Delegate Function PowerDeviceOn(ByVal autoPowerOff As DateTime) As Boolean

    Note: Not available
    1. Report
  7. Question: You are creating an undo buffer that stores data modifications. You need to ensure that
    the undo functionality undoes the most recent data modifications first. You also need to ensure that the
    undo buffer permits the storage of strings only. Which code segment should you use? - (VB.Net)

    A
    Dim undoBuffer As New Stack(Of String)()

    B
    Dim undoBuffer As New Stack()

    C
    Dim undoBuffer As New Queue(Of String)()

    D
    Dim undoBuffer As New Queue()

    Note: Not available
    1. Report
  8. Question: You are writing a custom dictionary. The custom-dictionary class is named MyDictionary.
    You need to ensure that the dictionary is type safe. Which code segment should you use? - (VB.Net)

    A
    Class MyDictionary
    Inherits Dictionary(Of String, String)
    End Class

    B
    Class MyDictionary
    Inherits HashTable
    End Class

    C
    Class MyDictionary
    Implements IDictionary
    End Class

    D
    Private Class MyDictionary
    End Class
    Private t As New Dictionary(Of String, String)()
    Private dictionary As MyDictionary = DirectCast(t, MyDictionary)

    Note: Not available
    1. Report
  9. Question: You are creating a class to compare a specially-formatted string. The default collation
    comparisons do not apply. You need to implement the IComparable<string> interface. Which code
    segment should you use? - (VB.Net)

    A
    Public Class Person
    Implements IComparable(Of String)
    Public Function CompareTo(other As String) As Integer
    End Function
    End Class

    B
    Public Class Person
    Implements IComparable(Of String)
    Public Function CompareTo(other As Object) As Integer
    End Function
    End Class

    C
    Public Class Person
    Implements IComparable(Of String)
    Public Function CompareTo(other As String) As Boolean
    End Function
    End Class

    D
    Public Class Person
    Implements IComparable(Of String)
    Public Function CompareTo(other As Object) As Boolean
    End Function
    End Class

    Note: Not available
    1. Report
  10. Question: You are testing a newly developed method named PersistToDB. This method accepts a
    parameter of type EventLogEntry. This method does not return a value. You need to create a code
    segment that helps you to test the method. The code segment must read entries from the application log
    of local computers and then pass the entries on to the PersistToDB method. The code block must pass
    only events of type Error or Warning from the source MySource to the PersistToDB method. Which code
    segment should you use? - (VB.Net)

    A
    Dim myLog As New EventLog("Application", ".")
    For Each entry As EventLogEntry In myLog.Entries
    If entry.Source = "MySource" Then
    PersistToDB(entry)
    End If
    Next

    B
    Dim myLog As New EventLog("Application", ".")
    myLog.Source = "MySource"
    For Each entry As EventLogEntry In myLog.Entries
    If entry.EntryType = (EventLogEntryType.[Error] And EventLogEntryType.Warning) Then
    PersistToDB(entry)
    End If
    Next

    C
    Dim myLog As New EventLog("Application", ".")
    For Each entry As EventLogEntry In myLog.Entries
    If entry.Source = "MySource" Then
    If entry.EntryType = EventLogEntryType.[Error] OrElse entry.EntryType =
    EventLogEntryType.Warning Then
    PersistToDB(entry)
    End If
    End If
    Next

    D
    Dim myLog As New EventLog("Application", ".")
    myLog.Source = "MySource"
    For Each entry As EventLogEntry In myLog.Entries
    If entry.EntryType = EventLogEntryType.[Error] OrElse entry.EntryType =
    EventLogEntryType.Warning Then
    PersistToDB(entry)
    End If
    Next

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd