-
Every statement in VB.NET must end with “ ; “
A) TrueB) FalseExplanation: Statements in VB.NET need not to end with semicolon
-
The implementation code in a VB.Net method is enclosed between
A) { }B) ( )C) sub .. EndSub
-
By default Main Method in VB.NET take command line arguments
A) TrueB) False
-
Every Class definition in VB.NET must end with
A) End SubB) End ClassC) EndExplanation: End class is the keyword to end the class definition
-
When you a create a console application in VB.NET which of the following files are added by default to the project
A) Assembly info file and a Class fileB) Assembly info file and a Module fileC) Class file and a Module file
-
Every class should have the one of the following method so that an object can be constructed
A) Sub New( )B) Sub Main ( )C) Sub Create( )Explanation: Sub New( ) is the constructor in VB.Net with which object are instantiated
-
How do we implement Late Binding in VB.NET
A) Through the use of “Object” data typeB) Through InheritanceC) Through abstractionExplanation: As object data type can store virtually any value type can be determined during run time.
-
How do you create a Read only Property in VB.NET
A) Using Only Get..EndGet with in property definitionB) Using Only Set..EndSet with in property definitionC) Using both Get & Set
-
Which keyword is used in the method declaration to handle an Event
A) EventB) HandlesC) Raise
-
The constructors in VB.Net is similar to which event in previous versions of VB
A) Class_InitializeB) Class_LoadC) Class_Terminate
-
How do you terminate an object in VB.NET
A) By setting the object to NothingB) By setting the object to NullC) By setting the object to CloseExplanation: Nothing keyword destroys the object
-
Shared method can be invoked directly from the class itself
A) TrueB) False
-
How do you call non shared methods of a class
A) Directly invoking the method nameB) Invoking the method through the instance of that classC) None of the aboveExplanation: Only shared methods can be directly invoked, for non shared method class instance is very much required
-
Events can not be declared as shared in VB.NET
A) TrueB) FalseExplanation: Events can also be shared by declaring with Shared Keyword
-
The underlying mechanism used by the .NET environment for call back methods
A) PointersB) DelegatesC) None of the above
-
Every class we create in VB.NET can act as a base class
A) TrueB) FalseExplanation: Classes created with NotInheritable keyword can not be a base class. It is not possible to derive the classes from notinheritable classes
-
How do you create a subclass
A) With the help of Inherits keywordB) With the help of Using KeywordC) With the help of Implements Keyword
-
-
Which technique we use to achieve polymorphic behavior of an object
A) Late BindingB) Multiple InterfacesC) .NET ReflectionD) All of the aboveExplanation: All of these can be used to achieve polymorphic behavior of an object
-
VB.NET Interview Questions
Ans