• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

VB.Net Interview Questions Answers

Question - 11 : - What is the difference between VB and VB.NET ?.

Answer - 11 : - Object-based language and Does not support inheritance also ADO.Net does not give support for disconnected data architecture and there is No interoperability function and No support for threading. On the other hand VB.NET is Object-Oriented Programming language and ADO.Net gives support for disconnected data architecture also provides interoperability and Its uses managed code and supports threading also provides access to third-party controls like COM, DCOM .

Question - 12 : - What does it meant to say “the canonical” form of XML?

Answer - 12 : -   "The purpose of Canonical XML is to define a standard format for an XML document. Canonical XML is a very strict XML syntax, which lets documents in canonical XML be compared directly. Using this strict syntax makes it easier to see whether two XML documents are the same. For example, a section of text in one document might read Black & White, whereas the same section of text might read Black & White in another document, and even in another. If you compare those three documents byte by byte, they'll be different. But if you write them all in canonical XML, which specifies every aspect of the syntax you can use, these three documents would all have the same version of this text (which would be Black & White) and could be compared without problem. This Comparison is especially critical when xml documents are digitally signed. The digital signal may be interpreted in different way and the document may be rejected.

Question - 13 : - How does VB.NET/C# achieve polymorphism? 

Answer - 13 : -   Polymorphism is also achieved through interfaces. Like abstract classes, interfaces also describe the methods that a class needs to implement. The difference between abstract classes and interfaces is that abstract classes always act as a base class of the related classes in the class hierarchy. For example, consider a hierarchy-car and truck classes derived from four-wheeler class; the classes two-wheeler and four-wheeler derived from an abstract class vehicle. So, the class 'vehicle' is the base class in the class hierarchy. On the other hand dissimilar classes can implement one interface. For example, there is an interface that compares two objects. This interface can be implemented by the classes like box, person and string, which are unrelated to each other. C# allows multiple interface inheritance. It means that a class can implement more than one interface. The methods declared in an interface are implicitly abstract. If a class implements an interface, it becomes mandatory for the class to override all the methods declared in the interface, otherwise the derived class would become abstract. Can you explain what inheritance is and an example of when you might use it? The savingaccount class has two data members-accno that stores account number, and trans that keeps track of the number of transactions. We can create an object of savingaccount class as shown below.         savingaccount s = new savingaccount ( "Amar", 5600.00f ) ; From the constructor of savingaccount class we have called the two-argument constructor of the account class using the base keyword and passed the name and balance to this constructor using which the data member's name and balance are initialised. We can write our own definition of a method that already exists in a base class. This is called method overriding. We have overridden the deposit( ) and withdraw( ) methods in the savingaccount class so that we can make sure that each account maintains a minimum balance of Rs. 500 and the total number of transactions do not exceed 10. From these methods we have called the ba

Question - 14 : - How would you implement inheritance using VB.NET/C#?

Answer - 14 : - When we set out to implement a class using inheritance, we must first start with an existing class from which we will derive our new subclass. This existing class, or base class, may be part of the .NET system class library framework, it may be part of some other application or .NET assembly, or we may create it as part of our existing application. Once we have a base class, we can then implement one or more subclasses based on that base class. Each of our subclasses will automatically have all of the methods, properties, and events of that base class ? including the implementation behind each method, property, and event. Our subclass can add new methods, properties, and events of its own - extending the original interface with new functionality. Additionally, a subclass can replace the methods and properties of the base class with its own new implementation - effectively overriding the original behavior and replacing it with new behaviors. Essentially inheritance is a way of merging functionality from an existing class into our new subclass. Inheritance also defines rules for how these methods, properties, and events can be merged. In VB.NET we can use implements keyword for inheritance, while in C# we can use the sign ( :: ) between subclass and baseclass

Question - 15 : - What is the difference between DataTable and DataSet ?.

Answer - 15 : - Dataset: Represents an in-memory cache of data we can also say data set is a collection of data table it is based on xml format ,it is used for data storing in cache as a disconnected recordset dataset is using data manipulation in cache wthout connection to database. DataTable: Represents one table of in-memory data data table can have one table only or we can say Data table is a collection of record's that consist the single table ..

Question - 16 : - What happens when you encounter a continue statement inside the for loop?

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

Question - 17 : - Why is it a bad idea to throw your own exceptions?

Answer - 17 : -   Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.

Question - 18 : - Write the role of New keyword ?

Answer - 18 : - New is used to initialize a new object. We sets a variable to any dattype with help of New keyword .The New keyword gives a value to the variable.We can also uses new keyword to initialize an object variable. Example:- dim obj as new SqlDataAdapter.

Question - 19 : - What's different about namespace declaration when comparing that to package declaration in Java?

Answer - 19 : -   No semicolon.

Computer Contributors

krishan
Rajeev Katiyar
Yes Baroda

Share your email for latest updates

Name:
Email:

Our partners