Dear Readers, Welcome to VB.Net Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your Job interview for the subject of VB.Net. These VB.Net Questions are very important for campus placement test and job interviews. As per my experience good interviewers hardly plan to ask any particular questions during your Job interview and these model questions are asked in the online technical test and interview of many IT companies.
vb.net is a windows based programming language.it supports oops concept.
system.object
namespace is a collection of different classes. whereas an assembly is the basic building blocks of the .net framework.
calling a non-virtual method, decided at a compile time is known as early binding. calling a virtual method (pure polymorphism), decided at a runtime is known as late binding.
microsoft intermediate language(msil or il) is the cpu -independent instruction set into which .net framework programs are compiled. it contains instructions for loading, storing initializing, and calling methods on objects.
clr also known as common language run time provides a environment in which program are executed, it activate object, perform security check on them, lay them out in the memory, execute them and garbage collect them.
the common type system is a rich type system, built into the common language runtime, which supports the types and operations found in most programming languages.
The common language specification is a set of constructs and constraints that serves as a guide for library writers and compiler writers.
private assembly is used inside an application only and does not have to be identified by a strong name.
shared assembly can be used by multiple applications and has to have a strong name.
System.web.ui.page
Assembly are the basic buiding blocks of the .net framework.they are the logical grouping of the functionality in a physical file.
Increased performance. better code management and encapsulation. it also introduces the n-tier concepts and business logic.
CAS - code access security is the part of the .net security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running.
structures are value type and classes are reference type
structures can not have constructors or destructors.
classes can have both constructors and destructors.
structures do not support inheritance, while classes support inheritance.
Dataset.clone copies just the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesn’t copy the data.
dataset.copy, copies both the dataset structure and the data.
Internal keyword is one of the access specifier available in .net framework , that makes a type visible in a given assembly , for e.g : a single dll can contain multiple modules.
Use debug class for debug builds, use trace class for both debug and release builds.
Access modifiers are keywords used to specify the declared accessibility of a member or a type. this section introduces the four access modifiers :
§ public
§ protected
§ internal
§ protected inertnal
§ private
The file format used for executable programs and for files to be linked together to form executable programs.
System.string is immutable, system.stringbuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
Tracing refers to collecting information about the application while it is running. you use tracing information to troubleshoot an application.
A process is an instance of an running application. and a thread is the execution stream of the process. a process can have multiple thread.
Serialization is the process of converting an object into a stream of bytes.
de-serialization is the opposite process of creating an object from a stream of bytes.
serialization/de-serialization is mostly used to transport objects.
Hiding a base class method by declaring a method in derived class with keyword new. this will override the base class method and old method will be suppressed.
A special method always called whenever an instance of the class is created.
Mean by more than one form. ability to provide different implementation based on different number / type of parameters.
An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body.
DLL is an in-process component whereas exe is an out-process component.exe is for single use whereas you can use dll for multiple use.
exe can be started as standalone where dll cannot be.
Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. the global assembly cache stores assemblies that are to be shared by several applications on the computer. this area is typically the folder under windows or winnt in the machine.
The cas security policy revolves around two key concepts - code groups and permissions. each .net assembly is a member of a particular code group, and each code group is granted the permissions specified in a named permission set.
Metadata and manifest forms an integral part of an assembly( dll / exe ) in .net framework . out of which metadata is a mandatory component , which as the name suggests gives the details about various components of il code viz : methods , properties , fields , class etc.
System.object
When overriding a method, you change the behavior of the method for the derived class. overloading a method simply involves having another method with the same name within the class.
A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.
The arraylist object is a collection of items containing a single data type values.
The member defined as static which can be invoked directly from the class level, rather than from its instance.
A process of creating different implementation of a method having a same name as base class, in a derived class. it implements inheritance.
When we need to override a method of the base class in the sub class, then we give the virtual keyword in the base class method. this makes the method in the base class to be overridable. methods, properties, and indexers can be virtual, which means that their implementation can be overridden in derived classes.
An xml namespace is a collection of element types and attribute names. it consists of 2 parts
the first part is the uri used to identify the namespace
the second part is the element type or attribute name itself.
A constructor is invoked when you use the new operator, or use the various methods of reflection to create an instance of a class.
System.string is immutable, system.stringbuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
JIT (just - in - time) is a compiler which converts msil code to native code (ie. cpu-specific code that runs on the same computer architecture).
calling a non-virtual method, decided at a compile time is known as early binding. calling a virtual method (pure polymorphism), decided at a runtime is known as late binding.
dataadapter’s fill () method is used to fill load the data in dataset.
An assembly controls many aspects of an application. the assembly handles versioning, type and class scope, security permissions, as well as other metadata including references to other assemblies and resources. the rules described in an assembly are enforced at runtime.
Authentication is the process of identifying users. authentication is identifying/validating the user against the credentials (username and password).
authorization performs after authentication. authorization is the process of granting access to those users based on identity. authorization allowing access of specific resource to user.
There are 3 types of authentication.
windows authentication
forms authentication
passport authentication.
The literal control is used to display text on a page. the text is programmable. this control does not let you apply styles to its content.
Namespace is a logical grouping of class.
system
system.data
system.io
system.drawing
system.windows.forms
system.threading
The clr allows any versions of the same-shared dll (shared assembly) to execute at the same time, on the same system, and even in the same process. this concept is known as side-by-side execution.
There are three types of caching :
output caching
fragment caching
data caching.
Reference type : reference types are allocated on the managed clr heap, just like object types. a data type that is stored as a reference to the value’s location. reference types can be self-describing types, pointer types, or interface types.
Value type : value types are allocated on the stack just like primitive types in vbscript, vb6 and c/c++. value types are not instantiated using new go out of scope when the function they are defined within returns.
Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it.
Authentication is the process of identifying users. authentication is identifying/validating the user against the credentials (username and password).
authorization performs after authentication. authorization is the process of granting access to those users based on identity. authorization allowing access of specific resource to user.
Static class is a class which can be used or accessed without creating an instance of the class.
Sealed classes are those classes which can not be inherited and thus any sealed class member can not be derived in any other class. a sealed class cannot also be an abstract class.
There are the two main parts of the .net framework are :
the common language runtime (clr).
the .net framework class library.
Stringbuilder is more efficient in cases where there is a large amount of string manipulation. strings are immutable, so each time it's being operated on, a new instance is created.
All .net compilers produce metadata about the types defined in the modules they produce. this metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection.
An application domain can be thought of as a lightweight processes controlled by the .net runtime. application domains are usually created by hosts like windows shell, asp.net and ie. when you run a .net application from the command-line, the host is the shell. the shell creates a new application domain for every application.
Compiler :
a compiler is a program that translates program (called source code) written in some high level language into object code.
Interpreter:
an interpreter translates high-level instructions into an intermediate form, which it then executes. interpreter analyzes and executes each line of source code in succession, without looking at the entire program; the advantage of interpreters is that they can execute a program immediately. .
Class is concrete representation of an entity. it represents a group of objects, which hold similar attributes and behavior. it provides abstraction and encapsulations.
Object represents/resembles a physical/real entity. an object is simply something you can give a name.
Hiding the complexity. it is a process of defining communication interface for the functionality and hiding rest of the things.
Int32.parse(string)
convert.toint32()
Source code is compiled and run in the .net framework using a two-stage process. first, source code is compiled to microsoft intermediate language (msil) code using a .net framework-compatible compiler, such as that for visual basic .net or visual c#. second, msil code is compiled to native code.
Boxing :
boxing is an implicit conversion of a value type to the reference type.
examples : stuct type, enumeration type
Unboxing :
unboxing is an explicit conversion from the reference to a value type.
examples : class , interface.
System.threading.thread
Method overloading occurs when a class contains two methods with the same name, but different signatures.
An override method provides a new implementation of a member inherited from a base class. the method overridden by an override declaration is known as the overridden base method.
Inline code written along side the html in a page. code-behind is code written in a separate file and referenced by the .aspx page.
An abstract class is a class that must be inherited and have the methods overridden. an abstract class is essentially a blueprint for a class without any implementation.
Datagrid is used in windows application and gridview is used in web and in datagrid we cannot write the code for datagrid properties where as for grid view we can write the code like template column item template etc this will not be done in datagrid.
The system.diagnostics namespace provides the interfaces, classes, enumerations and structures that are used for tracing.
the system.diagnostics namespace provides two classes named trace and debug that are used for writing errors and application execution information in logs.
Assemblies can be static or dynamic.
Static assemblies :
can include .net framework types (interfaces and classes), as well as resources for the assembly (bitmaps, jpeg files, resource files, and so on).staticassemblies are stored on disk in portable executable (pe) files.
Dynamic assemblies :
which are run directly from memory and are not saved to disk before execution. you can save dynamic assemblies to disk after they have executed.
structures are value type and classes are reference type.
structures can not have contractors or destructors. classes can have both contractors and destructors.
structures do not support inheritance, while classes support inheritance
Class : is logical representation of object. it is collection of data and related sub procedures with defination.
Interface : is also a class containg methods which is not having any definations.class does not support multiple inheritance. but interface can support.
The errorprovider control is used to indicate invalid data on a data entry form.
When .net was introduced it came with several languages. vb.net, c#, cobol and perl, etc. 44 languages are supported.
Many.
Metadata means data about the data i.e., machine-readable information about a resource, . such information might include details on content, format, size, or other characteristics of a data source. in .net, metadata includes type definitions, version information, external assembly references, and other standardized information.
Custom controls are compiled code (dlls), easier to use, difficult to create, and can be placed in toolbox. drag and drop controls. attributes can be set visually at design time.
auser control is shared among the single application files.
“params” keyword is used as to accept variable number of parameters.
There are three types of jit :
pre - jit
econo - jit
normal - jit.
c# is case sensitive while vb is not case sensitive.
vb.net does not support xml while c# support xml
vb.net supports with constructor while c# do not.
In debug compilation, assert takes in a boolean condition as a parameter, and shows the error dialog if the condition is false. the program proceeds without any interruption if the condition is true.
The memory representation of string is an array of characters, so on re-assigning the new array of char is formed & the start address is changed . thus keeping the old string in memory for garbage collector to be disposed.
Convert.tostring handles null while i.tostring() does not handles null.
There are 5 transactions types that can be used with com+.
disabled
not supported
supported
required
required new
A datatable is a class in .net framework and in simple words a datatable object represents a table from a database.
124.
A dataset is an in memory representation of data loaded from any data source
An inproc is one which runs in the same process area as that of the client giving tha advantage of speed but the disadvantage of stability becoz if it crashes it takes the client application also with it.
outproc is one which works outside the clients memory thus giving stability to the client, but we have to compromise a bit on speed.
Managed code: code that runs under a "contract of cooperation" with the common language runtime. managed code must supply the metadata necessary for the runtimeto provide services such as memory management, cross-language integration, code access security, and automatic lifetime control of objects. all code based on microsoft intermediate language (msil) executes as managed code.
Un-managed code:code that is created without regard for the conventions and requirements of the common language runtime. unmanaged code executes in the common language runtime environment with minimal services (for example, no garbage collection, limited debugging, and so on).
Constants: the value can’t be changed.
Read-only: the value will be initialized only once from the constructor of the class.
Static: value can be initialized once.
Convert.tostring handles null while i.tostring() does not handles null.
The main advantages of .net are :
.net is a language independent
automatic memory management(garbage collection)
disconnected architecture
object oriented.
Strong type is checking at the variables in compile time.
weak typing is checking the variables at run-time.
System.object is the root class in .net .
65536
The .net framework loads and executes the .net applications, and manages the state of objects during program execution. this also provides automatically garbage collections.
Strong name is similar to guid (it is supposed to be unique in space and time).
in com components. strong name is only needed when we need to deploy assembly in gac.
strong names use public key cryptography (pkc) to ensure that no one can spoof it. pkc use public key and private key concept. following are the step to generate a strong name and sign an assembly:
Shell("cmd.exe /c c:\first.exe < in.txt > out.txt")
An assembly can have only one entry point from dllmain, winmain or main.
Remotable objects are the objects that can be marshaled across the application domains. you can marshal by value, where a deep copy of the object is created and then passed to the receiver. you can also marshal by reference, where just a reference to an existing object is passed.
There are 3 types of authentication.
windows authentication
forms authentication
passport authentication.
System.globalization
system.resources
System.data
system.data.oledb
system.data.sqlclient
Session object store information between http requests for a particular user.
session variables are used to store user specific information where as in application variables we can’t store user specific information.
while application object are global across users.
A static constructor is used to initialize a class. it is called automatically to initialize the class before the first instance is created or any static members are referenced.