VB.Net interview questions for freshers/VB.Net Interview Questions and Answers for Freshers & Experienced

Briefly explain CLS and CTS?

CLS: CLS stands for Common Language Specification. CLS is referred to as a subset of CTS and it is used for uniting all languages under one single umbrella. CLs also extends to provide its extensible support to all the .NET language into a single unit.

CTS: CTS stands for Common Type System. CTS is used for communicating between the languages. For example, if VB has an Integer data type and C++ has a long data type and these data types will not be compatible with each other.

What is the difference between ‘system.string’ and ‘system.string builder’ classes?

While the ‘system.string’ class creates a new string object, updating in the same string object is possible for string builder class instead. Also, the operation of a string builder is much faster and efficient as compared to the string class.

What do you understand by Global Assembly Cache (GAC)?

As an experienced VB.net professional, you’re expected to be familiar with various terminologies used in the language such as GAC, CTS, serialization, CLS, etc. You need to explain that GAC or Global assembly cache is used where shared .NET assembly resides. Below are the criteria for using GAC:

1. f.net application has to be shared with other applications.
2. If.net assembly has any special security requirements.

What Is Versioning In .net?

main advantage of .net is versioning and solve very critical problem.
.net maintain one application with more then one version and also solve DLL HELL problem because it can run same application with different version at a same time[.Net have an Assembly. It gives the Portable Execution file.The main use of assembly is to maintain the Dll and exe's.
So sometimes the programmer confused to which is modified code.That time the assembly provide the Version.That is called versioning. It is start from 1.0.*,.......]

What is your understanding of .net framework?

Irrespective of your experience in vb.net language, this is a frequently asked question at interviews. You need to explain that the .net framework is a collection of different classes and services and exists as a layer between .net applications and the underlying operating system. Also, talk about how.net framework consists of different web forms, window forms, and console applications.

What are Destructors in VB.NET?

A Destructor is used to release or delete the objects that have been created by Constructor. In VB.NET, the Garbage Collector automatically manages the allocation , assignment and release of memory for the managed objects in your application. However, you may require Destructors to delete unmanaged resources that your application creates. There can be only one destructor for a class.

Enlist Tools for VB.NET Development.

The tools for VB.NET development are as follows:

1. Mono Development Platform (Linux)
2. Microsoft Visual Studio

Explain Friend Access Modifier in VB.NET.

The Friend keyword in the declaration statement specifies that the elements can be manipulated from within the same assemby but not from outside the assembly.

What Is An Indexed Property?

you include the index parameter in the Property statement. In this example, the test_number parameter is the index for the Scores property.
Public Class Student
' The private array of scores.
Private m_Scores(9) As Integer
' The indexed Score property procedures.
Public Property Score(ByVal test_number As Integer) As _ Integer
Get
Return m_Scores(test_number)
End Get
Set(ByVal Value As Integer)
m_Scores(test_number) = Value
End Set
End Property
End Class

Enlist the Differences between VB and VB.NET.

1. VB.NET is an Interpreted Language whereas VB.NET is a Compiled one.

2. Visual Basic is a Backword compatible whereas VB.NET is not backward compatible.

3. VB cannot be used to develop Multi-Threaded applications whereas VB.NET helps to develop Multi-Threaded applications.

Difference between System.String and System.StringBuilder classes?

System.string class is non-updatable and it will create a new string object instead of updating the same.

But updating in the same string object is possible for the StringBuilder class. So, the operation of a string builder is faster and efficient than the string class.

What is the use of Option explicit?

Variable must be compulsorily declared when the Option Explicit is termed as ON. If it is OFF, variables can be used without declaration.

What are the types of generations in garbage collector?

There are three types of generations in garbage collector.

Generation 0 – This identifies a newly created object that has been never marked for collection.

Generation 1 – This identifies an object which has been marked as collection but not removed.

Generation 2 – This identifies an object that has survived more than one sweep of the Garbage collector.

What are all the differences between Dispose and Finalize()?

Finalize method is called by Garbage collector which helps us to make free of unmanaged resources. There are some other resources like window handles, database connections are handled by iDisposable interface.

Dispose method is handled by IDisposable interface to explicitly release unused resources. Dsipose can be called even if other references to the object are alive.

What is ReDim keyword and its use?

Redim keyword is exclusively used for arrays and it is used to change the size of one or more dimensions of an array that has been already declared. Redim can free up or add elements to an array whenever required.

1. Dim intArray(7, 7) As IntegerReDim Preserve intArray(7, 8)ReDim intArray(7, 7)

How should I cast in VB.NET?

Are all of these equal? Under what circumstances should I choose each over the others?

1.ToString()
2.CStr(var)
3.CType(var, String)
4.DirectCast(var, String)
EDIT: Suggestion from NOTMYSELF…
5.TryCast(var, String)

Those are all slightly different and generally have acceptable usage.
TOSTRING()is going to give you the string representation of an object, regardless of what type it is. Use this if var is not a string already.
CSTR(var)is the VB string, cast operator. I’m not a VB guy, so I would suggest avoiding it, but it’s not really going to hurt anything. I think it is basically the same as CType.
CTYPE(var, String)will convert the given type into a string, using any provided conversion operators.
DIRECTCAST(var, String)is used to up-cast an object into a string. If you know that an object variable is, in fact, a string, use this. This is the same as (string)var in C#.
TRYCAST(as mentioned by @NotMyself) is like DirectCast, but it will return Nothing if the variable can’t be converted into a string, rather than throwing an exception. This is the same as var as a string in C#. The TryCast page on MSDN has a good comparison, too.

Test if an object implements an interface

I have an object parameter and I need to check if the object implements a specified interface in vb.net. How to test this?
Thanks.

Use TYPEOF…IS:
If TypeOf object parameter Is ISpecifiedInterface Then
‘do stuff
End If

Difference Between Vb Dll And Assemblies In .net ?

Assemblies can contain DLL and EXE both. Different versions of one DLL can be handled by assemblies. They overcome the DLL Hell problem. Assemblies Contain Manifest and Meta Data files. These are the separate files that describes the Assembly and its attributes. VB DLL is inprocess.DLL run with an exe where as DLL are not self executable.
we can reuse DLLs .DLL are not platform independent If we have more then one Versions of a DLL we can face DLL Hell Problem.

Is Vb.net Object Oriented? What Are The Inheritances Does Vb.net Support ?

yes VB.NET ia an object oriented.Vb.net supports all inheritance
1)single inheritance
It means Single class inheriting to single child classes
2)multiple inheritance
multiple classess inherits to single classes
3)Multilevel Inheritance
Single class inherits to one class that class inheritd to single another class
4)Heirarichal inheritance
Single class inherits to Multiple classes
5)Hybrid Inheritance
Single class inherits to different classess and that classes inherits to one class.

What are all the differences between Dispose and Finalize()?

Finalize method is called by Garbage collector which helps us to make free of unmanaged resources. There are some other resources like window handles, database connections are handled by iDisposable interface.

Dispose method is handled by IDisposable interface to explicitly release unused resources. Dsipose can be called even if other references to the object are alive.

What is Manifest?

A Manifest is a text file that is used to store metadata information of .NET assemblies. File type of Manifest can be saved as a type PE. Assembly Name, Version, Culture and key token can be saved as a Manifest.

What is jagged array in VB.Net?

Jagged array is nothing but an array of arrays. Each entry in the array is another array that can hold any number of items.

What is Hashtable?

Hashtable is set to be items with key and value pairs. Keys are referred to as indexes and a quick search can be performed for values by searching through the keys.

What is the use of New Keyword?

New keyword is used with the constructor in which it can be used as a modifier or an operator. When it is used as a modifier, it hides inherited member from the base class member. When it is used as an operator, it creates an object to invoke constructors.

1. Dim frm As New Form1 frm.show()

What is Hashtable?

Hashtable is set to be items with key and value pairs. Keys are referred to as indexes and a quick search can be performed for values by searching through the keys.

Difference between int and int32?

Int32 represents 32-bit signed integer whereas it is not a keyword used in VB.Net.

Difference between System.String and System.StringBuilder classes?

System.string class is non-updatable and it will create a new string object instead of updating the same.
But updating in the same string object is possible for the StringBuilder class. So, the operation of a string builder is faster and efficient than the string class.

What is Garbage Collection in VB.net?

Garbage collection is also known as automatic memory management, which is used for automatic recycling of dynamically allocated memory. Garbage collection is performed by a Garbage collector which will recycle memory if it is sure that memory will be unused.

Explain jagged array in VB.Net?

The jagged array is an array of arrays. Each entry in the array is another array that can hold any number of items.

What are Option Strict and Option Explicit?

Net generally allows implicit conversion of any data types. In order to avoid data loss during data type conversion, Option Strict keyword is used and it ensures compile time notification of these types of conversions.

Option Explicit is the keyword used in a file to explicitly declare all variables using declare keywords like Dim, Private, Public or Protected. If undeclared variable name persists, an error occurs at compile time.

What Is Intermediate Language In .net ?


.net supports CLS i. e. Common language type. its a microsoft’s feature to bring all languages near one roof. When You compile .net code it doesn't converted into binary language, it converted into IL (Intermediate Language) also known as MSIL. And from IL to binary language converted at run time, CLR manages this process. At the runtime also it not converts whole project at time to binary, only converts that part which is going to execute, this the performance of project increases. This IL can use any language which is member of that .net studio. The assemblies (ExE, DLL) are also in IL form. So u can use any EXE or DLL created in vb.net in c#.net also.[which converts native code into byte code i.e machine understandable code.]

How Do You Rate Yourself In .net ?


Based on Framework understanding and OOPS Concepts,Use of Different Component Library.

What Does Vs.net Contains ?


Visual Studio .Net is basically a framework which makes easy development of codes written in Various programming languages.. It contains two things
1.Framework Class Library: It contains various classes managed within various namespaces.
2.Common Language Runtime: CLR is the execution engine which helps in compiling the IL code into machine code,takes care of security issues and many other critical tasks.Web pages, windows apps, console applications, Class libraries are various options which can be created using VS.net.

How Do You Validate Date By Using Which Validation Control?

<asp:regularexpressionvalidator id="regExpDate"
runat="server"
ValidationExpression="^d{2}[/-]d{2}[/-]d{2,4}$"
ErrorMessage="It is not a valid date"
ControlToValidate="txtpatientvisitdate"
EnableClientScript="False"
Display="Dynamic"></asp:regularexpressionvalidator>

How Can We Assigns Items On Listbox So That It Will Show Rowwise Please Write The Code For It.

Lisbox1.Items.Add "Prashant"
Lisbox1.Items.Add "Chinchu"
Lisbox1.Items.Add "Pallavi"
Lisbox1.Items.Add "Suresh"
Lisbox1.Items.Add "Polika"

What are Option Strict, Option Explicit, and INTERNAL keyword in.Net Framework?

.Net generally allows implicit conversion of any data types. In order to avoid data loss during data type conversion,
option strict keyword is used and it ensures compile-time notification of these types of conversions.

Option Explicit is the keyword used in a file to explicitly declare all variables using declare keywords like Public, Dim, Private, or Protected.
If an undeclared variable name persists, an error occurs at compile time.

What is INTERNAL keyword in .Net Framework?

INTERNAL keyword is one of the access specifier which will be visible in a given assembly i.e. in a DLL file. This forms a single binary component and it is visible throughout the assembly.

Explain Metadata, namespace, which namespace is used for accessing the data, What is JIT?

Metadata is termed as “Data about the content of the data” and it is found in the catalog of libraries. Practically, it is used to analyzed data of database can be used for some other purpose also.
A namespace is an organized way of representing Class, Structures, and interfaces present in the .NET language. Namespaces are a hierarchically structured index of a class library, available to all .NET Languages.

It stands for Just in Time compiler which is used as a part of the runtime execution environment. There are three types of JIT and they are:

>> Normal JIT – Compiles called methods at runtime and they get compiled the first time when called.
>> Pre-JIT – Compiles at the time of deployment of an application.
>> Econo-JIT – Compiles called methods at runtime.

What are the different types of assembly?

There are two types of assembly –

>> Private – A private assembly is normally used by a single application and it is stored in application’s directory.

>> Public – A public assembly or shared assembly is stored in Global Assembly Cache(GAC) which can be shared by many applications

What's the difference between or and OrElse?

if temp is dbnull.value or temp = 0
produces the error *Operator ‘=’ is not defined for type ‘DBNull’ and type ‘Integer’.**
while this one works like a charm!
if the temp is dbnull.value OrElse temp = 0

OrElse is a short-circuiting operator Or is not.
By the definition of the boolean ‘or’ operator, if the first term is True then the whole is definitely true – so we don’t need to evaluate the second term.
OrElse knows this, so don’t try and evaluate temp = 0 once it’s established that temp Is DBNull.Value
Or doesn’t know this, and will always attempt to evaluate both terms. When temp Is DBNull.Value, it can’t be compared to zero, so it falls over.
You should use… well, whichever one makes sense.

What is strong name in .NET assembly?

Strong Name is an important feature of .Net and it is used to identify shared assembly uniquely. Strong name has solved the problem of creating different object with same name and it can be assigned with the help of Sn.exe.

What is an assembly and its use?

An assembly is one of the elements of a .NET application and it termed as a primary unit of all .NET applications. This assembly can be either DLL or executable file.

What is JIT?

JIT is termed as Just in Time compiler which is used as a part of runtime execution environment. There are three types of JIT and they are:

>> Pre-JIT – Compiles at the time of deployment of an application
>> Econo-JIT – Compiles called methods at runtime
>> Normal JIT – Compiles called methods at runtime and they get compiled first time when called

Which namespace are used for accessing the data?

System.Data namespace is used for accessing and managing data from the required data source. This namespace deals only with the data from the specified database.

What do you understand by the term namespace? Can you tell us which namespace is recommended to use for accessing the data?

A namespace is referred to as an organized way of representing Classes, interfaces, Structures that are present in .NET language. Namespaces are hierarchically structured indexes of a class library,which are available to all .NET Languages. In simple terms, the namespace is used for grouping the classes logically. The System.Data namespace is the namespace that is used for the accessing and management of the data from the required data sources. This namespace deals only with the data from the database that is specified.

Define CTS in the Vb.Net framework?

CTS in the Vb.net framework represents the common type of system. This is also considered as a subset of the common language specification. CTS also helps the user to keep consistency while developing codes. Microsoft later added that the Common type system is designed to keep equality and relatively within the multiple languages within the same .net Programming frameworks.

What is the entry methods used in Vb.net frameworks?

Sub Main command indicates the entry point in the Vb.Net program.

What is the Vb.Net framework?

The Vb.Net framework is a platform-independent and language-independent tool developed by the leading software company Microsoft. This tool supports multiple programming languages such as C#, Visual Basic script, J Script, C++ codes, and many more. Vb.net also allows user to run their codes on multiple platforms such as Linux, Mac OS, Windows XP, and UNIX. This programming tool also contains various libraries that help in faster application development, cheaper, and easy to use.

What is Metadata?

Metadata is termed as “Data about content of the data” and it is found in the catalog of libraries. Practically, it is used at back side of book to see the necessary topic.

What do you know about VB.Net? Briefly explain.

Vb.net is referred to as one of the programming languages which is available in Visual Studio. Net. VB.Net also contains different features of visual basic, also called as an event-based programming language. VB.Net also includes the different object-oriented concepts. In simple terms, VB.Net is a programming language that is an extension of Visual Basic in order to make it compliant with the .Net Framework. Also, VB.Net is called a fully Object Oriented programming language which is different from Visual Basic and everything in VB.Net consists of only an object.

As it is compliant with the .Net Framework, VB.Net is flexible to make use of the different Framework Class Libraries that are provided by .Net Framework. VB.Net is used in order to create the software interface and codes by the programmers and is also referred to as the combination of the various components that are being used on the forms which also have some specific actions and attributes.

Search
R4R Team
R4R provides VB.Net Freshers questions and answers (VB.Net Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,VB.Net interview questions for freshers,VB.Net Freshers & Experienced Interview Questions and Answers,VB.Net Objetive choice questions and answers,VB.Net Multiple choice questions and answers,VB.Net objective, VB.Net questions , VB.Net answers,VB.Net MCQs questions and answers Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for VB.Net fresher interview questions ,VB.Net Experienced interview questions,VB.Net fresher interview questions and answers ,VB.Net Experienced interview questions and answers,tricky VB.Net queries for interview pdf,complex VB.Net for practice with answers,VB.Net for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .