VB.NET Interview Questions and answers

Question.1  What would you do to remove Microsoft visual basic name space?

Answer:  .NET has many new features and application supportive tools. To remove Microsoft visual basic name space all you have to do is to

1) Remove the import manually every time you start the project.

2) Creating a template which does not contain Microsoft Visual Basic namespace.

3) About new features and changes names you can refer to MSDN.

Question.2  Name some of the features of C# which are not present in VB.NET?

Answer:  Some of the features which are not present in VB are as follows they are: –

1) It supports unsafe code blocks for improved performance.

2) Partial interfaces and anonymous methods.

3) Multi line comments and static classes. Etc [sociallocker]

Question.3  Name a feature which is common to all .NET languages?

Answer:  There is only one feature which is common to all languages and that is Garbage collection or GC. This feature is automated which relieves developers of much work. This garbage is disposed only when there is need of memory or stress for memory. GC feature halts the application for few seconds before restarting it.

Question.4  Name and explain some of the exclusive features which are present in VB?

Answer:  Some of the features which are exclusive to VB are as follows: –

1) Name space can be hidden which can be disabled.

2) Certain project files can be hidden and a user can show them if he intends to do.

3) Lots and lots of shortcuts are present which ease the development of programs.

4) Using the AddressOf myObject function a delegate can be made.

Question.5  Explain about Visual basic.NET culture?

Answer:  VB was always a RAD tool and it was always user friendly for any type of user whether professional or not. It also provided many users with shortcuts and features which made this language popular among many users. It had its share of debugging and maintenance issues of course.

Question.6  Compare C# and Visual basic.NET?

Answer:   .NET Frame work includes two languages which are language to IL compilers and in this C# and VB.NET are provided. The importance and flexibility of these as better programming languages is still questionable. Visual basic has been updated and revised to make it object oriented whereas C# has concepts from many languages such as Delphi, Java, etc and syntax from C and Java.

Question.7  Explain about the performance of Visual basic?

Answer:  Visual basic 5 and 6 are efficient in coding the code to native or P-code depending upon the programmer. Portability is a major addition to the performance of VB.NET and the code is also small. Additional layer is provided which interprets the code and this can be avoided by using special algorithms and native code programming.

 Question.8  What are the various open source tool available for VB.NET?

Answer:  When compared with the rapid development of open source tools for other languages from Microsoft (C#, etc) we can say that development of tools for VB has been slow. Mono development platform is one which is implementing VB libraries and is working on a compiler.

Question.9  Describe about Visual basic.NET?

Answer:   This is used in conjunction with Microsoft .NET platform and is a successor to visual basic sixth version. Visual basic is used in conjunction with.NET Framework. This tool has a serious defect it is not compatible with Microsoft visual basic sixth version. It has a huge library which assists programmers.

Question.10  Explain and brief about rapid application development tool?

Answer:   Rapid action development tool describes about the software development process. This tool gives flexibility in iterative development and prototype deployment. It enhances the speed of application development. It is also used for application maintenance.

Question.11  Name some of the features present in VB 2005?

Answer:   Some of the features present in VB 2005 are as follows: –

Edit and continue: – It allows developers to modify and execute applications almost simultaneously.

Namespace: – This provides access to various parts of the .NET framework and it also dynamically generates classes.

Data source binding function is very useful for client server development.

Question.12  Explain about .NET?

Answer:    .NET is a Microsoft Framework and a software component. .NET has a large library of pre-coded solutions which provided developer significant help in developing applications with solutions already present. It offers reliable security and cross platform compatibility.

Question.13  Explain about visual basic?

Answer:   Visual basic is associated with the IDE of Microsoft. It is basically useful to implement RAD of GUI. Creation of Active X scripts are very easy and efficient through VB. Windows API can also be used to create application on windows desktop and its applications. This was primarily designed to create applications for windows platform.

Question.14  What is a delegate, why should you use it and how do you call it ?

Answer:  A delegate is a reference type that refers to a Shared method of a type or to an instance method of an object. Delegate is like a function pointer in C and C++. Pointers are used to store the address of a thing. Delegate lets some other code call your function without needing to know where your function is actually located. All events in .NET actually use delegates in the background to wire up events. Events are really just a modified form of a delegate.

It should give you an idea of some different areas in which delegates may be appropriate:

1.They enable callback functionality in multi-tier applications as demonstrated in the examples above.

2.The CacheItemRemoveCallback delegate can be used in ASP.NET to keep cached information up to date. When the cached information is removed for any reason, the associated callback is exercised and could contain a reload of the cached information.

3. Use delegates to facilitate asynchronous processing for methods that do not offer asynchronous behavior.

4.Events use delegates so clients can give the application events to call when the event is fired. Exposing custom events within your applications requires the use of delegates.

Question.15  Where do you add an event handler?

Answer:  It’s the Attributesproperty, the Add function inside that property.

e.g. btnSubmit.Attributes.Add(“”onMouseOver””,””someClientCode();””)

Question.16   So how do you retrieve the customized properties of a .NET application from XML .config file? Can you automate this process?

Answer:   Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable. In Visual Studio yes, use Dynamic Properties for automatic .config creation, storage and retrieval.

Question.17  Whats the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?

Answer: A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

Question.18  What happens when you encounter a continue statement inside the for loop?

Answer:  The code for the rest of the loop is ignored, the control is transferred back to the beginning of the loop.

Question.19  Whats the difference between const and readonly?

Answer:  The readonly keyword is different from the const keyword. A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for runtime constants as in the following example:

public static readonly uint l1 = (uint) DateTime.Now.Ticks; [/sociallocker]

Get a Live DEMO On Visual Basic Training