Showing posts with label Visual Basic. Show all posts
Showing posts with label Visual Basic. Show all posts

Saturday, February 13, 2021

Visual Basic .NET (VB.NET) Mcq Question Answer Part - 6

Question: 1. Only derived class can have shadows keyword

Option A. True
Option B. False

Question: 2. For the same class "Me" and MyBase" are same
Option A. True
Option B. False

Question: 3. If you want to open a file named "a.txt" use
Option A. System.diagnostics.Start("a.txt")
Option B. System.Start("a.txt")
Option C. System.diagnostics.Process.Start("a.txt")
Option D. System.Process.Start("a.txt")

Question: 4. _________ actually updates the values in a DataSet permanently
Option A. OleDataAdapterq1.update(DataSet1,"emp")
Option B. DataSet1.Merge(DataSet1)
Option C. DataSet1.AcceptChanges()
Option D. DataSet1.Update()

Question: 5. /*1. OleDataAdapterq1.update(DataSet1,"emp")
2. OleDataAdapterq1.update(DataSet1,"std")
3. DataSet1.Merge(DataSet1)
4. DataSet1.AcceptChanges()
/* The error is in line
Option A. 2
Option B. 4
Option C. 3
Option D. No Error

Question: 6. Using ADODB multiple tables can be connected at a time
Option A. True
Option B. False

Question: 7. A DataSet can be updated only when the connection is open
Option A. True
Option B. False

Question: 8. To redimension an array with its previous values intact use ___________ keyword
Option A. RedimPreserve
Option B. Preserve
Option C. Redim
Option D. Redim Preserve

Question: 9. _________ and _____________ combines to make a KeyPress event
Option A. KeyUp, KeyDown
Option B. KeyEnter, KeyRelease
Option C. KeyDown, KeyRelease
Option D. KeyEnter, KeyUp

Question: 10. To retrieve the default path of the project use
Option A. Application.Path
Option B. Application.DefaultPath
Option C. Application.StartupPath
Option D. Application.ProjectPath

Question: 11. Application.StartupPath actually points to
Option A. //ProjectName
Option B. //ProjectName/Bin
Option C. //ProjectName/Debug
Option D. //ProjectName/Bin/ProjectName.exe

Question: 12. A form can not call itself
Option A. True
Option B. False

Question: 13. If a form call another form and the caller form is closed through code, then both forms are disposed
Option A. True
Option B. False

Question: 14. When a project is Built it creates a _______ and ________ file under Bin directory
Option A. .exe, .sln
Option B. .exe, .dll
Option C. .dll, .sln
Option D. .exe, .ocx

Question: 15. The EventLog's ________ method is used to write an entry to a log file
Option A. WriteLine
Option B. WriteEntry
Option C. Add
Option D. Append

Question: 16. A form can have only one default button
Option A. True
Option B. False

Question: 17. If a button click event is to be fired when the user press the 'Esc' key, set the buttons name against forms _________ property
Option A. DefaultButton
Option B. AcceptButton
Option C. DialogResult
Option D. CancelButton

Question: 18. If nothing is selected in a combo box, its index value is
Option A. -1
Option B. 0
Option C. 1
Option D. Null

Question: 19. A Windows Service if installed cannot be uninstalled
Option A. True
Option B. False

Question: 20. To uninstall a Windows Service ____________ is use
Option A. Installutil -I
Option B. Installutil -e
Option C. Installutil -u
Option D. Installutil -d

Answer Sheet

1A
2A
3C
4C
5D
6B
7B
8D
9A
10C
11B
12B
13A
14B
15B
16A
17D
18A
19B
20C

VB.NET MCQ Question Answer Part - 5

Question: 1. PasswordChar property of a TextBox can accept " " (space) as the password char

Option A. True
Option B. False

Question: 2. If Scrollbars property of a TextBox is set to Hortizontal and the WordWrap property is also set to true. Which one will get precedence
Option A. Scrollbars
Option B. WordWrap
Option C. No precedence both will work

Question: 3. A single LinkLabel can support multiple links
Option A. True
Option B. False

Question: 4. To add items stored in an array to a ListView use
Option A. List1.Add(name of the array)
Option B. List1.AddItem(name of the array)
Option C. List1.Items.Add(name of the array)
Option D. List1.Items.Addrange(name of the array)

Question: 5. This property of TrackBar is not present
Option A. TickStyle.Both
Option B. TickStyle.None
Option C. TickStyle.TopLeft
Option D. TickStyle.BottomLeft

Question: 6. Default event handler of Splitter is
Option A. Splitter.Click
Option B. Splitter.Clicked
Option C. Splitter.Drag
Option D. None of the above

Question: 7. A form can have only ______ Main Menu and _________ Context Menu
Option A. 1,1
Option B. 1,Multiple
Option C. Multiple,1
Option D. 1,2

Question: 8. The Apply button automatically appears of the Font Dialog Box is opened
Option A. True
Option B. False

Question: 9. A user wants that custom colors are visible when the Color Dialog Box is first Opened. What should he do?
Option A. Set AllowFullOpen to True
Option B. Set AnyColor to True
Option C. Set Open to True
Option D. Set FullOpen to True

Question: 10. To print use
Option A. PrintDialog1.Print()
Option B. PrintDocument1.Print()
Option C. Printer1.Print()
Option D. None of the above

Question: 11. In TreeView to get the node the mouse is pointing to, use
Option A. GetNode
Option B. Node
Option C. GetNodeAt
Option D. SelectNode

Question: 12. A TreeView can have multiple root nodes
Option A. True
Option B. False

Question: 13. To view Panels of a StatusBar set _________ to true
Option A. Panel
Option B. Panels
Option C. ShowPanel
Option D. ShowPanels

Question: 14. The default Tab of a Tab Control is
Option A. The first tab
Option B. The last tab added
Option C. The last tab modified
Option D. There is no default tab.

Question: 15. If a Class in inherited, its constructor is inherited automatically and it is fired automatically
Option A. True
Option B. False

Question: 16. To override Finalize function the scope of the function must be
Option A. Private
Option B. Public
Option C. Protected
Option D. Static

Question: 17. Class cc
public _________ I as string
end class
Button1_Click
cc.I=100
Option A. Share
Option B. Shared
Option C. Global
Option D. Static

Question: 18. If an user-defined class have a user-defined event then, the class object is declared as
Option A. Dim c as new ClassName
Option B. Dim withEvents c as new ClassName
Option C. Dim c as ClassName
Option D. Dim withEvents c as ClassName

Question: 19. /*1. Class C
2. public mustinherit sub abc()
3. msgbox("Base Class")
4. end sub
5. end Class /* The error is in line no.
Option A. 1
Option B. 2
Option C. 3
Option D. 4

Question: 20. /*1. Class C
2. public notoverridable sub abc()
3. msgbox("Base Class")
4. end sub
5. end Class /* The Error in Line No.
Option A. 2
Option B. 3
Option C. 4
Option D. No Error

Answer Sheet

1B
2B
3A
4D
5D
6D
7B
8B
9D
10B
11C
12A
13D
14A
15A
16C
17B
18B
19A
20A

VB.NET New MCQ Question Answer Part-4

 

Question: 1. DataSet can be used to connect to Crystal Report

Option A. True
Option B. False

Question: 2. dim arr(10) as string,
the max index of the array is
Option A. 9
Option B. 10
Option C. Can be >10 also
Option D. None of the above

Question: 3. Use a _________ statement to make Visual Basic object the default object for a set of enclosed Visual Basic statements.
Option A. With
Option B. Using
Option C. Import
Option D. Inherit

Question: 4. If Option Explicit is on then Dim i as Integer="10" will produce an error
Option A. True
Option B. False

Question: 5. Dim a() as Integer-{1,2,3,4}is a valid statement
Option A. True
Option B. False

Question: 6. ___________ is used to pass copies of a variable while __________ is used to pass address of a variable.
Option A. Byval, Byref
Option B. Byref, Byval
Option C. Any one of the above
Option D. None of the above

Question: 7. A function can have multiple return statements
Option A. True
Option B. False

Question: 8. Function abc() As String
Return 10
End Function
Option A. Will produce compilation error
Option B. Will produce runtime error
Option C. The function will execute normally
Option D. None of the above

Question: 9. On error goto lbl is a
Option A. Structured error
Option B. Unstructured error

Question: 10. To get details about an error use
Option A. Err.Message
Option B. Err.Desc
Option C. Err.Description
Option D. Err.Number

Question: 11. Finally is fired only when error occurs
Option A. True
Option B. False

Question: 12. Get method is used to
Option A. Assign a value to an user control
Option B. Read value from an user control
Option C. Both of the above
Option D. None of the above

Question: 13. Set method is used to
Option A. Assign a value to an user control
Option B. Read value from an user control
Option C. Both of the above

Question: 14. The correct sequence of Form Loading is
Option A. Load
Option B. Initialize, Load, Activate
Option C. Initialize, Activate, Load
Option D. Activate, Initialize Load

Question: 15. InputBox by default returns ________ values
Option A. Integer
Option B. Byte
Option C. Double
Option D. String

Question: 16. To add controls at runtime use
Option A. Controls.New
Option B. Controls.AddNew
Option C. Controls.Add
Option D. Controls.AddItem

Question: 17. To call a buttons click event use
Option A. Button1.Click
Option B. Button1.PerformClick
Option C. Button1.Clicked
Option D. None of the above

Question: 18. To vertically arrange all forms in an MDI form use
Option A. Me.Layout(MdiLayout.TileVertical)
Option B. Me.MdiLayout(MdiLayout.TileVertical)
Option C. Me.LayoutMdi(MdiLayout.TileVertical)
Option D. Nothing is required because default is Vertical

Question: 19. While handling keystrokes if e.Handled=True is set then Visual Basic
Option A. Will handle the key
Option B. Will not handle the key
Option C. Will send the key to Garbage collector
Option D. None of the above

Question: 20. Dim S as Integer=10
Text1=S
Msgbox(Text1.Text)
Option A. Will return error
Option B. Will return 10
Option C. Will return 0
Option D. Will return Null

Answer Sheet

1A
2B
3A
4B
5A
6A
7B
8A
9B
10C
11B
12A
13B
14B
15D
16C
17B
18C
19B
20A