2021 MCQ 1
2021 MCQ 1
a) Symantec
b) Ashton-Tate
c) Microsoft
d) Sybase
3. Which of the following extension is used to represent the project file in Visual Basic?
a) .vbp
b) .vb
c) .cls
d) .vvb
a) Char
b) Int
c) Object
d) String
5. Which of the following applications can be developed using Visual Basic tool?
6. In Visual Basic, which of the following is used for coding single-alternative and dual-
alternative selection structures?
a) Switch-Case block
b) If…Then…Else statement
c) function overloading
d) Recursion
7. What will be the output of the following Visual Basic code, If the intnumber variable
is 110?
If intnumber<=100 Then
Intnumber=intnumber*2;
Else
Intnumber=intnumber*3;
EndIf
a) 180
b) 330
c) 156
d) 270
8. In the Visual Basic application, which of the following are listed in a properties
window?
a) Items
b) Values
c) Attributes
d) Objects
a) -3043.88
b) -3034.88
c) -3408.48
d) -3304.88
10. Which of the following is commonly used to perform an immediate action when
clicked in Visual Studio?
a) Button control
b) Close
c) End
d) Exit
11. In the following Visual Basic code, what will be in msg, if str contains “visual
basic”?
Dim str as String
Dim msg as String
If str.toUpper=”VISUAL BASIC”
msg=”VB.Net”
Else
msg=”Not Visual Basic”
EndIf
a) Bye
b) Hi
c) Logical Error
d) Compiler Error
12. Which of the following displays the list of projects contained in the Visual Basic
current solution?
a) List Window
b) Project Window
c) Catalogue Window
d) Solution Explorer Window
13. Which of the following method is used to sort an array in visual basic?
a) Array.Sort()
b) Array.sortAscending()
c) Array.arrayArrange()
d) Array.arrange()
14. Which of the following is the caption part for the following Visual Basic command?
MessageBox.Show("Delete Visual Basic?","VB.Net",MessageBoxButtons.YesNo,
MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2).
a) MessageBoxButtons.YesNo
b) MessageBoxIcon.Exclamation
c) “VB.Net”
d) “Delete Visual Basic?”
15. Which of the following instruction tells the computer to close the current form in
Visual Basic?
a) This.Close()
b) Me.Close()
c) Close.this()
d) Close()
a) Defining events
b) Operations
c) Defining actions
d) Event procedures
17. What output will be returned if the following Visual Basic code is executed?
strVisualBasic = "Sanfoundry, VB.Net"
intCharIndex = strVisualBasic.IndexOf("VB")
a) 11
b) 12
c) False
d) True
18. What will be the output of the following Visual Basic code?
Dim intScores As Integer = {78, 83, 75, 90}
Array.Reverse(intScores)
a) 78,75,83,90
b) 90,75,83,78
c) 78, 83, 75,90
d) 75,78, 83,90
19. Which of the following is used to write a stream of characters in Visual Basic?
a) StreamReader object
b) StreamReader class
c) StreamWriter object
d) StreamWriter class
20. What is the value of len in the following Visual Basic code?
Dim strVB() As String = {"Sanfoundry", "Visual Basic", "VB.Net", "Visual Studio"}
Dim len As Integer
len = strVB.Length()
a) 3
b) 5
c) 4
d) 0
21. Which of the following is the default name assigned to the label control in Visual
Basic?
a) Label1
b) DefaultLabel
c) Label0
d) NewLabel
22. Which of the following toolbox is used to include an image on the Visual Basic form?
23. In visual basic language what are the rules of a programming language called?
a) Grammar
b) Order
c) Syntax
d) Rules
24. What happens when both the minimize box and maximize box property are set to
false in Visual Basic?
25. In Visual Basic, which of the following keyword tells the computer to pass the
variable’s address rather than its contents?
a) ByAdd
b) ByPoint
c) ByRef
d) ByVal
26. Which of the following forces a literal constant to assume a data type other than the
one its form indicates?
a) Any literal
b) Keyword
c) Literal type constant
d) Literal type variable
27. Which of the following is used to display a message box in Visual Basic?
a) MessageBox.Show
b) MessageBox.show
c) MessageBox
d) AlertBox.View
28. In Visual Basic, which of the following method converts a string to a number?
a) Convert
b) Tryparse
c) Extern
d) Parse
29. Which of the following is used to convert a number from one data type to another in
visual studio?
a) Literal constant
b) Object
c) Convert class
d) Parser
a) Character
b) Pure
c) Intrinsic
d) Invariable
31. The position of an item in a list box depends on which of the following property of
the value stored in the list box’s?
a) Unsorted property
b) Sorted property
c) Descending Property
d) Ascending property
32. Which of the following returns a value after performing its specific task in Visual
Basic?
a) Structure
b) Sub block
c) Sub procedure
d) Function Procedure
33. Which of the following property is used to specify a combo box’s style in Visual
Basic?
a) Style
b) ComboBoxStyle
c) DropDownStyle
d) DropStyle
34. What will be the output of the following Visual Basic code?
Dim intScores As Integer = {78, 83, 75, 90}
Array.Sort(intScores)
a) 90,83,78,75
b) 78,75,83,90
c) 78, 83, 75,90
d) 75,78, 83,90
35. Which of the following section is used to make text appear around the image?
a) Wrapping style
b) Text style
c) Image properties
d) Align
1.Any project that compiles to an EXE or DLL files produces an assembly in .NET?
True
False
2. COMException class is a part of ________?
System.Runtime.Interopservices
System.XML
System.Data
True
False
Option Strict On
Option Strict=1
Options Strict True
Option Strict off
5. Which of the following object is used by the DataAdapter to retrieve the data from
database?
Command
Connection
DataReader
6. Which of the following control doesn't receive the focus and doesn't have a TabIndex
property?
PictureBox
LablControl
ListBox
TabControl control
Public
Private
Friend
Protected
True
False
IsDdNull( )
IsEmpty( )
ISNull( )
10. Smart Phone applications and other such devices can be written using:
11. Which class is used to run the EXE application file in VB.NET?
Process
Application
Exe
Execute
12. Which of the following namespaces is used to access "computer name" and its IP
address in VB.NET?
System.NET.DNS
System.Diagnostics.Process
System.Data.Common
None of the Above
True
False
System .Object
System .Type
System .Data
15. What is the significance of Option Explicit statement when it is set to On?
Specifies that any variable name is declared (with type) before use
Specifies whether strings should be compared as binary
Specifies that variables should be initialized before use
16. Methods declared with the following modifier are not accessible outside the class?
Private
Protected
Friend
Global
System.Runtime.Interopservices
System.XML
System.Data
19. Which method of the XMLdocument class takes xml as string while loading
Loadxml( )
Load( )
Save( )
Showdialog( )
Activate( )
Loaddialog()
Show( )
Me
This
Super
True
False
25. The Visual Basic Upgrade Wizard will convert all the code in your VB 6 application
to VB.NET code for you?
False
True
Not always
Can't say
26. The vbc.exe compiler generates:
IL Code
Native code
Byte Code
None of these
Role-based security
Code-based security
Yes
No
BitArray
Enum
Queue
Stack
30. The smallest unit to which one can associate a version number in .NET is
CLR
Assembly
Namespace
None of the Above
-1
0
2
3
One
Two
Three
35. An Assemblyinfo file in a VB.NET project will have blank as file extesion?
.config
.vb
.cs
36. The methods which return the values back to the calling code are called
as__________?
Constructors
Interrogative methods
Imperative methods
37. Which interface allows to implement the Dispose method to do cleanup work
Idestructor
Icleanup
Idisposable
DataReader
Dataset
DataAdapter
40. The DataAdapter uses which of the following object to retrieve the data from
database
Connection
Command
DataReader
41. The tool provided with .Net framework to register assemblies for use by COM is
Regsvr32
Regasm
ILDASM
Regedit
Parent
MyBase
Super
Assert( )
Open( )
Flush( )
44. Some bits of a Visual Basic 6 application, like most APIs, can be easily migrated to
VB.NET; other parts are not so straightforward. Which of the following will NOT have
to be re-architected during a VB 6-to-VB.NET migration ?
DHTML pages
ADO to ADO via Interop
ActiveX documents
OLE controls
VB.NET
C#
Both of them will run equally fast.
None of these
47. Which of the following is the best to retrieve Read-Only, Forward-only stream of
data from database?
Data Set
Typed Data Set
DataReader
Assert( )
Flush( )
Open( )
49. ________is used to step through each line of code as it executes, including calls to
other function?
Step Out
Step Over
Step Into
Run to Cursor
50. The methods declared with the following modifiers are not accessible out side the
current VB.NET project
Public
Protected
Friend