0% found this document useful (0 votes)
51 views13 pages

2021 MCQ 1

Uploaded by

rajaduraicse1993
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views13 pages

2021 MCQ 1

Uploaded by

rajaduraicse1993
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

1. Who developed Visual Basic?

a) Symantec
b) Ashton-Tate
c) Microsoft
d) Sybase

2. Which of the following statement is used to define a class in visual basic?

a) Event class statement


b) Class statement
c) Form class statement
d) Event statement

3. Which of the following extension is used to represent the project file in Visual Basic?

a) .vbp
b) .vb
c) .cls
d) .vvb

4. If you keep a variable undeclared, it is automatically taken as to which of the


following data type in Visual Basic?

a) Char
b) Int
c) Object
d) String

5. Which of the following applications can be developed using Visual Basic tool?

a) Graphical User Interface


b) Real-time
c) Character User Interface
d) All of the mentioned

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

9. What will be the output of the following Visual Basic expression?


Financial.Pmt (0.05, 3, 9000)

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()

16. Object respond to an event by writing __________

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?

a) Add Image box


b) Picture Box
c) Add Picture Box
d) Image box

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?

a) Both are removed from the title bar


b) Both are disabled
c) This situation shows an exception
d) This situation shows an error

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

30. Which of the following type of constant is ControlChars.NewLine constant?

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

3. Default properties are always a parameterized property?

True
False

4. How do you limit implicit type conversion in VB.NET?

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

7. If no access modifier is specified for a class, it is considered _______?

Public
Private
Friend
Protected

8. In VB.NET, the finalizer must use the Overrides keyword?

True
False

9. Using ___________ we can determine if a variable is initialized in VB.NET?

IsDdNull( )
IsEmpty( )
ISNull( )
10. Smart Phone applications and other such devices can be written using:

.NET Compact Framework


.NET Small Framework
.NET Smartclient Framwork

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

13. Most of the underlying integration of .NET is done through XML

True
False

14. Every type supported by CTS is derived from __________?

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

17. How do you create a Read only Property in VB.NET

Using Only Get..EndGet with in property definition


Using Only Set..EndSet with in property definition
Using both Get and Set

18. Where do you find COMException class

System.Runtime.Interopservices
System.XML
System.Data

19. Which method of the XMLdocument class takes xml as string while loading

Loadxml( )
Load( )
Save( )

20. Which of the method is used to display the form as modal

Showdialog( )
Activate( )
Loaddialog()
Show( )

21. How do you add Web Methods in VB.Net

Add keyword to Method signature


Add [WebMethod] on top of the Method Signature
Add {WebMethod} on top of the Method Signature

22. How do you refer the current class in VB.Net

Me
This
Super

23. The serialization of an Object means that it is written out to a stream


True
False

24. Vb.Net classes can be derived in C#

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

27. ______ protects system resources from unauthorized calls?

Role-based security
Code-based security

28. Is the Class type in VB.NET a value type?

Yes
No

29. Which of the following is not the member of System.Collections?

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

31. Lower bound value of array in VB.NET?

-1
0
2
3

32. What is the purpose of Invoke Method?

Used to call any procedure


Used to call the procedure through Delegate variable
Both
None

33. How to dereference an object in VB.NET?

By setting the object to Null


By setting the object to Nothing
With Close keyword
None of the above

34. How many levels of compilation happens in .NET Framework?

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

38. How do you call non shared methods of a class

Directly invoking the method name


Invoking the method through the instance of that class
None of the above

39. Which is the base class for TypedDataset

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

42. How you refer the parent class in VB.Net

Parent
MyBase
Super

43. Which of the following is not a method of Debug class

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

45. What two controls are needed when creating a toolbar ?

Only Toolbar control


ImageList and Toolbar control
Both 1 and 2
All the above

46. A 'for' loop will run faster in VB.NET or C# ?

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

48. Which of the following is not a method of Debug class?

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

You might also like