DotNet using VB MCQs

DotNet using VB MCQs

Our experts have gathered these DotNet using VB MCQs through research, and we hope that you will be able to see how much knowledge base you have for the subject of DotNet using VB by answering these 100+ multiple-choice questions.
Get started now by scrolling down!

1: In which of the following types of applications can Windows Workflow Foundation be used?

A.   Console Applications

B.   Windows Forms based Applications

C.   Windows Presentation Foundation based Applications

D.   ASP.NET based applications

E.   All of the above

2: When aggregating data, LINQ is:

A.   much faster than DataTable.Compute

B.   much slower than DataTable.Compute

C.   almost as fast as DataTable.Compute 

3: Which of the following characteristics are found in a Query expression?

A.   It begins with a 'from' clause

B.   It begins with a 'select' clause

C.   It can end with a 'group' clause

D.   It contains at least one 'where' clause

E.   An 'orderby' clause may optionally follow a 'select' clause 

4: Which of the following are true about anonymous types?

A.   They can be derived from any reference type.

B.   Two anonymous types with the same named parameters in the same order declared in different classes have the same type.

C.   Anonymous types can have methods

D.   All properties of an anonymous type are read/write

E.   Anonymous types cannot cross method boundaries.

5: Within Windows Workflow Foundation, Compensating Actions are used for:

A.   providing a means to rollback a failed transaction

B.   providing a means to undo a successfully committed transaction later

C.   providing a means to terminate an in process transaction

D.   achieving load balancing by adapting to current activity 

6: Which of the following are goals of Windows Communication Foundation?

A.   Bringing various existing communication technologies into a unified environment.

B.   Cross vendor/platform communication.

C.   Support for asynchronous communications.

D.   Support for distributed applications based on technologies such as MSMQ and/or COM+

E.   All of the above 

7: What is the result of the following code?
Console.WriteLine(CBool(If(1>2, "True", "False")))

A.   Throws an InvalidCastException

B.   TRUE

C.   FALSE

D.   None of the above

8: What is the value of r after the following code is executed?
Dim f As Func(Of Integer, Boolean) = Function(x) (x + 2) > 7
Dim r = f(7)

A.   9

B.   TRUE

C.   The code will not compile due to an InvalidCastException

D.   May be 1 or -1, depending on the system setting for casting Boolean values to integers

9: Which of the following scenarios are applicable to Window Workflow Foundation?

A.   Document-centric workflows

B.   Human workflows

C.   User-interface page flows

D.   Builtin support for communications across multiple applications and/or platforms

E.   All of the above

10: Which of the following is most appropriate when using an implicitly typed array?

A.   All elements in the initializer list must be of the same type.

B.   All elements in the initializer list must be implicitly convertible to a known type which is the actual type of at least one member in  the initializer list

C.   All elements in the initializer list must be implicitly convertible to the common type which is the base type of the items actually in the list

D.   There are no restrictions on the items in the initializer list as the array is not declared to be a specific type. 

11: Which of the following are true about System.Security.Cryptography under version 3.5 of the framework

A.   None of the implementations are  FIPS-certified

B.   Support is provided for the "Suite B" set of cryptographic algorithms, as specified by the National Security Agency (NSA) .

C.   Cryptography Next Generation (CNG) classes are supported on XP and Vista systems

D.   The System.Security.Cryptography.AesManaged class allows custom block size, iteration counts and feedback modes to support any the Rijndael based encryption. 

12: When Windows Communication Foundation is used to develop a Web Service, which of the following are supported?

A.   WS-Addressing

B.   WS-MetadataExchange

C.   WS-Security

D.   WS-Atomic Transaction

E.   All of the above 

13: Which access limitation is there in a class member declared "Protected Friend"?

A.   Access is limited to the containing class plus any classes derived from the containing class

B.   Access is limited to the current assembly

C.   Access is limited to the containing class plus any classes derived from the containing class that are also in the current assembly

D.   Access is limited to the containing class plus any classes derived from the containing class or any other class in  the current assembly 

14: Which of the following are true about Extension methods?

A.   They must be declared static

B.   They can be declared either static or instance members

C.   They must be declared in the same assembly (but may be in different source files)

D.   Extension methods can be used to override existing instance methods

E.   Extension methods with the same signature for the same class may be declared in multiple namespaces without causing compilation errors 

15: Which features that are not supported in the System.TimeZone class does the System.TimeZoneInfo class provide?

A.   It provides readable names for both regular time and, if appropriate, daylight savings time

B.   It provides a means of enumerating the known time zones that are available on the local system

C.   It provides functionality to create custom time zones

D.   It provides the period the time zone was in effect for. For example: From 1986 to 2006, it was observed from the first Sunday in April to the last Sunday in October, but since  2007, it is being observed from the second Sunday in March t

16: The default number of threads per processor in the System.Threading.ThreadPool class under version 3.5 of the Framework is?

A.   1

B.   25

C.   250

D.   100

E.   500 

17: Which of the following are true regarding System.Web.Mail and System.Net.Mail namespaces?

A.   System.Web.Mail is not supported under version 3.5 of the Framework

B.   System.Web.Mail is deprecated under version 3.5 of the Framework, and it is officially recommended that System.Net.Mail be used.

C.   System.Web.Mail is the preferred solution when using IIS hosted applications

D.   There are no functional differences; the items were moved to a new namespace to reflect their applicability in a better way 

18: By which contract are the WS-Addressing action and reply action elements of the soap envelope controllable when Windows Communication Foundation is used?

A.   ServiceContract

B.   OperationContract

C.   DataContract

D.   MessageContract 

19: Which of the following are true regarding the System.Collections.Generic.HashSet(Of T) class

A.   HashSet is an unordered collection.

B.   HashSet requires that each element be unique as determined by either a supplied EqualityComparer or the default EqualityComparer

C.   Operations on sets (Union, Intersection, etc) always create new result sets

D.   HashSet provides functionality for "conceptual sets" where the rules for membership can be specified without actually creating all of the items.

E.   All of the above 

20: Which of the following statements do Expression Trees fit best?

A.   Expression trees are a data structure which can be initially composed using language syntax.

B.   Expression trees are a dynamically generated code which is executed to perform the desired function.

C.   Expression trees can be created only from Lambda Expressions

D.   Expression trees can be modified directly

E.   All of the above

21: Which of the following is true regarding the System.DateTimeOffset structure?

A.   It provides an exact point in time relative to the UTC time zone

B.   It combines a DateTime structure with a TimeZone structure

C.   It provides arithmetical operations using values with different offsets from UTC

D.   It can be used to determine the specific TimeZone for a local time 

22: Which of the following are true about System.GC under version 3.5 of the Framework?

A.   You can request that the garbage collector processes a generation if it determines that it is appropriate at specific points in your code

B.   You can control the intrusiveness of the garbage collector (i.e. how often it performs collections) while your program is running

C.   You can control the intrusiveness of the garbage collector (i.e. how often it performs collections) only during application initialization

D.   You should specify LowLatency when using Concurrent Server Garbage Collection to improve memory utilization 

23: To which contract is the SessionMode property to disallow, require, or permit applied when Windows Communication Foundation is used?

A.   ServiceContract

B.   OperationContract

C.   DataContract

D.   MessageContract 

24: Which of the following does System.IO.Pipes namespace provide?

A.   Interprocess communication through anonymous and/or named pipes.

B.   Access to named pipes using System.IO.Stream

C.   Access to the system level pipe security implemented as discretionary access control lists (DACL) and/or system access control lists (SACL),

D.   Asynchronous read and write operations

E.   All of the above 

25: Which of the following do the advantages of Lambda Expressions over Anonymous methods include?

A.   More concise syntax

B.   The types for a Lambda Expression may be omitted

C.   The body of an anonymous method can not be an expression

D.   Lambda Expressions permit deferred type interference that anonymous methods do not

E.   All of the above 

26: When using version 3.5 of the framework in applications which emit dynamic code, which of the following are true?

A.   A partial trust code cannot emit and execute a code

B.   A partial trust application must have the SecurityCritical attribute called  Assert ReflectionEmit permission

C.   The generated code no more permissions than the assembly which emitted it.

D.   Can be executed by calling
System.Reflection.Emit.DynamicMethod(
    string name,
    Type returnType,
    Typ

27: Given the following code, which of the following are syntactically correct?

   Public Function AppendTest(ByVal s As String, ByVal suffix As String)
  Return s & suffix
 End Function

A.   Dim s As String = s = s.AppendTest(s,

B.   Dim s As String = s = s.AppendTest(

C.   Dim s As String = s = AppendTest(s,

D.   Dim s As String = s = AppendTest(

28: Which of the following are true of ADO.NET?

A.   It uses a connected provider model

B.   It uses a disconnected provider model

C.   It includes a DataAdapter class, which provides a high-performance mechanism for retrieving data

D.   System.Data.Common provides classes that are database agnostic 

29: Transactions initiated in which of the following are supported by System.Transactions infrastructure?

A.   SQL Server

B.   ADO.NET

C.   MSMQ

D.   Microsoft Distributed Transaction Coordinator (MSDTC).

E.   All of the above 

30: Which System.Remoting class is used to transfer information across an AppDomain boundary?

A.   ObjRef

B.   MarshalByRefObject

C.   ObjectHandle

D.   RemotingServices

31: Which of the following are true about Nullable types?

A.   A Nullable type is a reference type.

B.   A Nullable type is a structure.

C.   An implicit conversion exists from any non-nullable value type to a nullable form of that type.

D.   An implicit conversion exists from any nullable value type to a non-nullable form of that type.

E.   A predefined conversion from the nullable type S? to the nullable  type T? exists if there is a predefined conversion from the non-nullable type S to the non nullable type T  

32: When Deleting a DataRow from the DataRowCollection of a DataTable, you can:

A.   use the DataRowCollection.Remove method to immediately delete  the row.

B.   use the DataRowCollection.Remove method to mark the row for deletion when DataRow.AcceptChanges is called.

C.   use the DataRow.Delete method to immediately delete  the row.

D.   use the DataRow.Delete method to mark the row for deletion when DataRowAcceptChanges is called.

33: Which of the following are true about using the System.Messaging.MessageQueue class?

A.   It provides communication across heterogeneous networks

B.   It provides communication when one of the endpoints may be off-line

C.   It may behave differently depending on the current operating system

D.   A new system level queue may be created simply by creating  an instance of MessageQueue.

34: Which of the following are true of the System.Text.StringBuilder class?

A.   It is less efficient than string concatenation when many concatenations are performed.

B.   There is a method which formats the string being appended to the StringBuilder, much like the String.Format.

C.   The StringBuilder is most efficient when initialized using the parameterless constructor.

D.   All of the above

E.   None of the above 

35: Which of the following are true about BackgroundWorker?

A.   It is a member of the System.Threading namespace.

B.   It abstracts away the details of cross-thread marshalling of data.

C.   The BackgroundWorker thread aborts immediately when the CancelAsync method is called.

D.   It provides mechanisms for reporting progress, reporting completion and cancelling 

36: Which of the following will be executed without error?
Public Class Fruit
End Class
Public Class Apple
    Inherits Fruit
End Class

A.   Dim list As New List(Of Fruit)
        list.Add(New Apple)
        list.Add(New Fruit)

B.   Dim list As New List(Of Fruit)
        list.Add(New Apple)
        list.Add(New Fruit)

C.   Dim list As New List(Of Apple)
        list.Add(New Apple)
        list.Add(New Fruit)

D.   Dim list As New List(Of Apple)
        list.Add(New Apple)
        list.Add(New Fruit)

37: What will be the output generated by the following code?
        Dim t As String = "This Is a Test"
        t.Replace("T", "?")
        Console.WriteLine(t)

A.   ?his Is a ?est

B.   ?his Is a ?es?

C.   This Is a Test

D.   ?his Is a Test

38: Which of the following are required to be true by objects which are going to be used as keys in a System.Collections.HashTable?

A.   They must handle case-sensitivity identically in both the GetHashCode() and Equals() methods.

B.   Key objects must be immutable for the duration they are used within a HashTable.

C.   Get HashCode() must be overridden to provide the same result, given the same parameters, regardless of reference equalityl unless the HashTable constructor is provided with an IEqualityComparer parameter.

D.   Each Element in a HashTable is stored as a Key/Value pair of the type System.Collections.DictionaryElement

E.   All of the above

39: What output will be generated by the following code?
Dim sb As New StringBuilder(10)
        sb.AppendFormat("1234567890123")
        Console.WriteLine(sb.Capacity)

A.   10

B.   13

C.   Some value equal to or larger than 13

D.   Int32.MaxValue 

40: Which method calls will compile the following?
    Private Sub Sample(ByVal number As Integer, Optional ByVal bool As Boolean = True)
    End Sub

A.   Sample(1, True)

B.   Sample(1)

C.   Sample(bool:=False)

D.   Sample(bool:=False, number:=1)

E.   Sample(bool:=False, 1)

41: Which of the following are true with respect to the standard implementation of Garbage Collection?

A.   Objects must be set to null in order to be eligible for garbage collection

B.   Unless specific steps are taken, an object may be moved in memory

C.   Objects become eligible for garbage collection as soon as it is impossible for any code to access it

D.   Objects which implement finalizers will always have the finalizer called at some point

42: In which of the following ways do structures differ from classes?

A.   Structures cannot implement interfaces

B.   Structures cannot inherit from a base structure

C.   Structures cannot have events

D.   Structures cannot have overrideable methods 

43: Which access limitation does a class member declared Protected Friend have?

A.   Access is limited to the containing class plus any classes derived from the containing class

B.   Access is limited to the current assembly

C.   Access is limited to the containing class plus any classes derived from the containing class that are also in the current assembly

D.   Access is limited to the containing class plus any classes derived from the containing class or any other class in the current assembly

44: Which of the following types guarantee atomic reads and writes?

A.   int

B.   double

C.   string

D.   long

E.   float

45: Given the following code, which calls will be valid ways to add the elements of a string array to a List(Of String)?
        Dim values() As String = {"1", "2", "3", "4"}
        Dim valueList As New List(Of String)

A.   valueList.Insert(values)

B.   valueList = values

C.   valueList.Add(values)

D.   valueList.AddRange(values)

46: What is the value of b3 after the following code is executed?
Dim b1 As Boolean? = True
Dim b2 As Boolean? = Nothing
Dim b3 As Boolean? = IIf(b1 AndAlso b2, b1, b2)

A.   System.DbNull.Value

B.   TRUE

C.   FALSE

D.   Nothing

E.   None of the above (An InvalidCastException is thrown)

47: Which of the following are valid assignments?

A.   Dim i As Int32 = Int16.MaxValue

B.   Dim s As Single = Double.MaxValue

C.   Dim s2 As String = Int64.MaxValue

D.   Dim i2 As Int32 = Int64.MaxValue 

48: Which of the following is NOT part of an assembly?

A.   Manifest

B.   MetaData

C.   Intermediate Language Code

D.   Resources

E.   Native Executable Code 

49: An executable code that will be dynamically created within a running application__________.

A.   is not possible with VB

B.   should be done using the Microsoft.VisualBasic.Compiler class

C.   should be done using the Microsoft.VisualBasic.VBCodeProvider class

D.   should be done by explicitly creating a process and running vbc.exe

E.   requires that Visual Studio is installed and automated to create the new code 

50: Which of the following are true when comparing built in types for equality?

A.   Integral types are considered equal if they represent the same value.

B.   Object types are considered equal if they both refer to the same object or if both are null

C.   String types are considered equal if they have identical lengths and identical characters in each character position

D.   String types are considered equal if they have identical dimensions  and identical content at each array index