26. What is the purpose of Optional keyword in VB.NET?
Optional − Specifies that a procedure argument can be omitted when the procedure is called.
27. What is the purpose of Out keyword in VB.NET?
Out − For generic type parameters, the Out keyword specifies that the type is covariant.
28. What is the purpose of Overloads keyword in VB.NET?
Overloads − Specifies that a property or procedure redeclares one or more existing properties or procedures with the same name.
29. What is the purpose of Overridable keyword in VB.NET?
Overridable − Specifies that a property or procedure can be overridden by an identically named property or procedure in a derived class.
30. What is the purpose of Overrides keyword in VB.NET?
Overrides − Specifies that a property or procedure overrides an identically named property or procedure inherited from a base class.
31. What is the purpose of ParamArray keyword in VB.NET?
ParamArray − ParamArray allows you to pass an arbitrary number of arguments to the procedure. A ParamArray parameter is always declared using ByVal.
32. What is the purpose of Partial keyword in VB.NET?
Partial − Indicates that a class or structure declaration is a partial definition of the class or structure.
33. What is the purpose of Private keyword in VB.NET?
Private − Specifies that one or more declared programming elements are accessible only from within their declaration context, including from within any contained types.
34. What is the purpose of Protected keyword in VB.NET?
Protected − Specifies that one or more declared programming elements are accessible only from within their own class or from a derived class.
35. What is the purpose of Public keyword in VB.NET?
Public − Specifies that one or more declared programming elements have no access restrictions.
36. What is the purpose of ReadOnly keyword in VB.NET?
ReadOnly − Specifies that a variable or property can be read but not written.
37. What is the purpose of Shadows keyword in VB.NET?
Shadows − Specifies that a declared programming element redeclares and hides an identically named element, or set of overloaded elements, in a base class.
38. What is the purpose of Shared keyword in VB.NET?
Shared − Specifies that one or more declared programming elements are associated with a class or structure at large, and not with a specific instance of the class or structure.
39. What is the purpose of Static keyword in VB.NET?
Static − Specifies that one or more declared local variables are to continue to exist and retain their latest values after termination of the procedure in which they are declared.
40. What is the purpose of Unicode keyword in VB.NET?
Unicode − Specifies that Visual Basic should marshal all strings to Unicode values regardless of the name of the external procedure being declared.
41. What is the purpose of Widening keyword in VB.NET?
Widening − Indicates that a conversion operator (CType) converts a class or structure to a type that can hold all possible values of the original class or structure.
42. What is the purpose of WithEvents keyword in VB.NET?
WithEvents − Specifies that one or more declared member variables refer to an instance of a class that can raise events.
43. What is the purpose of WriteOnly keyword in VB.NET?
WriteOnly − Specifies that a property can be written but not read.
44. What is the purpose of Dim statement in VB.NET?
Dim Statement − Declares and allocates storage space for one or more variables.
Dim number As Integer
Dim quantity As Integer = 100
Dim message As String = "Hello!"
45. What is the purpose of Const statement in VB.NET?
Const Statement − Declares and defines one or more constants.
Const maximum As Long = 1000
Const naturalLogBase As Object
= CDec(2.7182818284)
46. What is the purpose of Enum statement in VB.NET?
Enum Statement − Declares an enumeration and defines the values of its members.
Enum CoffeeMugSize
Jumbo
ExtraLarge
Large
Medium
Small
End Enum
47. What is the purpose of Class statement in VB.NET?
Class Statement − Declares the name of a class and introduces the definition of the variables, properties, events, and procedures that the class comprises.
Class Box
Public length As Double
Public breadth As Double
Public height As Double
End Class
48. What is the purpose of Structure statement in VB.NET?
Structure Statement − Declares the name of a structure and introduces the definition of the variables, properties, events, and procedures that the structure comprises.
Structure Box
Public length As Double
Public breadth As Double
Public height As Double
End Structure
49. What is the purpose of Module statement in VB.NET?
Module Statement − Declares the name of a module and introduces the definition of the variables, properties, events, and procedures that the module comprises.
Public Module myModule
Sub Main()
Dim user As String =
InputBox("What is your name?")
MsgBox("User name is" & user)
End Sub
End Module
50. What is the purpose of Interface statement in VB.NET?
Interface Statement − Declares the name of an interface and introduces the definitions of the members that the interface comprises.
Public Interface MyInterface
Sub doSomething()
End Interface