Elance VB.NET Test Answers 2015
·
What is a button's default event type?
Click
Tick
MultilineChanged
MouseMove
Which term is not related to multithreading
issues?
ApartmentState
Mutex
SpinLock
Enumerable
In order to determine whether a dataset has
pending modifications to it's data, you would call which method?
Dataset.SaveRequired
Dataset.IsDirty
Dataset.SyncRequired
Dataset.HasChanges
What design window allows you to add controls
to a form?
properties window
custom design window
solutions explorer window
toolbox window
Which operation is performed first in the
following example? y = 17 + 7 / 2
the division operation of 7 / 2
the addition operation of 17 + 7
The serialization of an Object means that it
is written out to a stream
False
True
A property of an object can be another object.
False
True
What technology allows you to issue SQL-like
commands against a collection of objects in VB.Net?
WCF
LINQ
T-SQL
PLINK
The lowest bound value of arrays in VB.NET is
___ ?
Infinite
-1
0
1
True or False? An interface can inherit from
another interface.
True
False
Which method of the SQLCommand class would you
use to call a stored procedure which does not return any data?
ExecuteNonQuery
EndExecuteReader
ExecuteScalar
ExecuteReader
What object would you use to manipulate a
folder?
CreateDirectory
System.IO.Directory
OpenFileDialog
FileLen( )
A 'for' loop will run faster in VB.NET or C# ?
VB.NET
None of these
C#
Both of them will run equally fast.
In system.streamwriter, what method is used to
clear all buffers and causes any buffered data to be written to the underlying
stream?
Clear
Expel
Push
Flush
True or False? A WPF control can be embedded
inside of a Winforms application.
True
False
Can a Try-Catch-Finally block be nested inside
of the Finally section of another Try-Catch-Finally block?
No
Yes
To make a hidden form appear, you set what
property?
ControlBox to True
Visible property to True
ControlBox to False
Visible property to False
You use _________ to declare a procedure that
returns a value.
Call
MyProcedure
Function
Sub
What character donates a section of commented
code?
' apostrophe
$ dollar sign
{ curly braces
/ forward slash
____________ is when objects contain their
respective data and code.
Modification
Instantiation
Assignment
Encapsulation
A variable declared as: Dim Var as Integer =
5, after executing the next line of: Var -= 1, would have what value?
1
6
4
-5
Which class has a .Fill method which is used
to add or refresh rows in a dataset?
SQLCommandBuilder
SQLDependency
DataAdapter
DataConnection
What toolbar allows you to control alignment
and spacing?
base toolbar
normal toolbar
project toolbar
layout toolbar
What specific time value is attributed to the
Interval property in the TImer control?
nanoseconds
seconds
minutes
milliseconds
What type of Visual Basic project creates a
standard Windows program?
the Windows Forms Application
Windows Presentation Foundation
Console Application Template
Class Library Template
A collection of DataRows is called a ________.
System.Data
DataGroup
Data.Set
DataSet
What is the correct way of ending a VB.NET
Sub?
Close Sub
Kill
End Sub
End
Exit Sub
What does LINQ stand for?
Lowest-Integrated Question
Linear Query
Light Interface Number Query
Language-Integrated Query
What is the base class of all other .Net
classes?
net.base
assembly.root
system.object
system.base
Protected methods of a class are accessible
from their own class and from:
Abstract classes
No other classes
Derived classes
True or False? The Finally portion of a
Try-Catch-Finally block only executes when an error occurs.
True
False
When you open a loop with a For statement, you
can close the loop with a ___________ statement.
Next
End While
Do
EndLoop
It is possible to define a string type as
nullable?
False
True
What keyword should be used when declaring a
variable inside a method, whose value should remain the same between calls?
Fixed
Private
Immutable
Static
A class declared as: Public Class Sample(of
T), is an example of what type of class?
Anonymous
Dynamic
Fixed
Generic
To have your code executed when an if....then
statement evaluates to False, you use a ____________ clause.
GoTo
If Not
End If
Else
Terminate a For/Next loop with the _______
statement.
exit For
continue
exit
exit Loop
How many elements are there in the following
array? Dim X(3) as Integer
4
3
0
What character precedes a hotkey or
accelerator that you are creating?
# (hash)
- (hyphen)
& (ampersand)
$ (dollar sign)
When declaring two methods with the same names
but different parameter types, you should use which keyword?
Overloads
Overrides
Implements
Shadows
True or False? A class have both a shared and
non-shared constructor.
False
True
In order to copy the schemas, relationships
and constraints of a dataset but not any data you would utilize which method?
Dataset.Duplicate
Dataset.Copy
Dataset.Replicate
Dataset.Clone
In order to draw to a surface, use the
______________.
Graphics object
Control Panel
Pen Object
Paint event
How do you limit implicit type conversion in
VB.NET?
Option Strict = 1
Options Strict True
Option Strict On
Option Strict Off
How do you create a Read only Property in
VB.NET
Using Only Get..EndGet with in property definition
Using both Get and Set
Using Only Set..EndSet with in property definition
None of the above
BCL stands for?
Base Class Language
Bass Class Language
Binary Common Libraries
Binary Class Language
Base Class Libraries
The import required for the registry editing
is
System.Security.AccessControl
System.Security
System.Security.Permissions
Microsoft.Win32
True or False? A class cannot implement an
interface while also inheriting from a base class.
False
True
What is the purpose of Invoke Method?
Used to call the procedure through Delegate
variable
None
Used to call any procedure
Both
Which of the method is used to display the
form as modal?
Show( )
ShowDialog( )
ShowModal()
LoadDialog()
Activate( )
A class declared as friend is accessible from:
Anywhere in the same assembly
Only methods in the same class
Any derived class
Anywhere in another assembly
To determine which button is being pressed
during a mouse-related event, use the _________ property in that particular
event.
KeyUp
e.button
InputBox
KeyPress
In the declaration: Dim varA As Object, VarB,
VarC As Integer, what type is VarB?
Generic
String
Integer
Object
Which statement helps prevent multiple threads
from accessing the same codeblock at the same time?
SyncLock
MemLock
IsolateThreads
IsolateAccess
True or False? By default, parameters are
passed ByRef.
False
True
Which of the following is not a method of the
Textbox class?
ToString()
Flush()
Update()
Refresh()
SuspendLayout()
When you assign a value type to a reference
type, data is copied from the stack to the heap. What is this called?
Heaping
Registering
Unstacking
Boxing
COMException class can be found in
System.Debug
System.Exceptions
System.Data
System.Runtime.Interopservices
Can an Enum be declared and exposed from within
an Interface?
No
Yes
To hold a money value, you would use the
Object data type.
TRUE
False
You are using the SQLTransaction class for a
series of SQL statements. Where do you attach the SQLTransaction by using
BeginTransaction?
Attach to each SQLClient.SQLCommand
Attach to the SQLClient.SQLConnection
Which of the following is the most valid
example of the My object in Visual Basic?
Me.Text =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
Me.Text = My(Computer), FileSystem(SpecialDirectories),MyDocuments
Me.Text =
My(Computer.FileSystem.SpecialDirectories.MyDocuments)
The My object is not present in the Visual Basic
language.
Which is not a binding associated with WCF
services?
BasicHttpBinding
NetNamedPipeBinding
WSFederationHttpBinding
DiskSynchronousTransferBinding
Which control would you employ to present a
yes/no value to an end user?
a radio button
a check box
a text field
an accept button
Do reference types or value types have their
value stored on the stack?
Value
Reference
The correct syntax for the event that is fired
when the mouse pointer rests on a TextBox control is
OnMouseRest()
OnMouseUp()
OnMouseHover
OnMouseOver()
What method of the Thread class would you call
to force multiple threads to complete before moving on to the next section of
code?
Join
Bond
Merge
SetApartmentState
What is the difference between Or and OrElse?
Or has higher precedence than OrElse
Or can only be used for bitwise operations
Or does not short-circuit, while OrElse does
Or was deprecated and replaced with OrElse
Which keyword refers the parent of the current
object
Me
Mybase
This
Super
The following variable: Dim product = New With
{Key .Name = "paperclips", .Price = 1.29}, is referred to as:
An Anonymous Type
A Generic Class
An Enumerated Type
A Pseudo Class
Which of the following is a valid declaration
for a nullable integer type?
Dim num As Nullable Integer
Dim? num As Integer
Dim num As Integer<Nullable>
Dim num As Nullable(of Integer)
If no access modifier is specified for a
class, it is considered _______?
Private
Friend
Protected
Public
How many times can a class inherit from
different parent classes?
unlimited
0
2
1
What is the value of b after this code is
executed? Dim b As Boolean = Nothing
True
(this results in a runtime exception)
Nothing
False
Extension methods may only be declared inside
of:
Classes
Modules
Interfaces
Abstract Classes
Assuming s is a String and i is an Integer,
what data type does the following method call return: Int32.TryParse(s, i)
String
Boolean
Short
Integer
Char
In order to allow multiple WCF services to
listen on the same port, you must set which property of the binding class to
true?
AllowMultiplePorts
PortSharingEnabled
PermitDuplicatePort
EnablePortSharing
When both a parent class and a derived class
have both a shared and an instance CTOR, in what order do they fire when
creating an instance of the derived class like this: Dim MyObject as New
DerivedClass?
Derived Shared, Derived Instance, Parent Shared,
Parent Instance
Parent Shared, Parent Instance, Derived Shared,
Parent Instance
Derived Shared, Parent Shared, Parent Instance,
Derived Instance
Parent Instance, Derived Instance, Derived Shared,
Parent Shared
True or False? Tuples are value types as
opposed to reference types.
True
False
In order to allow assembly (a) to see methods
declared as friend in assembly (b), what attribute can you use?
ExposeAssemblyMethods
There is no such attribute
AllowFriendVisibility
InternalsVisibleTo
What is the value of DateTime.MinValue.Year?
1900
-1
1970
1
0
True or False? A public method declared inside
of a public module is accessible from another assembly.
False
True
True or False? The following array declaration
is valid: Dim X(-1) As Integer.
False
True
Subscribe to:
Posts (Atom)