.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

Statics and Dynamic Polymporphism

Posted By :Karthikeyan Anbarasan     Posted Date :July 31, 2011    Points :40   Category :.NET Framework 
Method Overloading or Static Polymorphism

Method overloading means having two or more methods with the same name but with different signatures



Method Overriding or Dynamic Polymorphism

Method overriding means having two or more methods with the same name , same signature but with different implementation. (Base class and Child class implementation of a method with same name and signature)

You can also find related Interview Question to Statics and Dynamic Polymporphism  below: 

What is the difference between "dynamic SQL" and "stored procedure" ?

  
Dynamic sql is the bunch of statements that dynamically constructed at run time and not stored in database.
Where as Stored procedures are stored in data base in complied form. (More...)

What is dynamic binding ? How is it different from static binding?

  
With dynamic binding, the decision on which object method to call is made at runtime.Dynamic binding is polymorphism. with static binding, the decision to on which method to call is made at compile time.c# uses static binding as the default method dispatching mechanism. (More...)

What is the difference between var and dynamic types in C# 4.0?

  
var gets processed in the compile time itself and shows any error during compile time itself.

dynamic gets processed in the runtime only and in case of errors it is hidden until runtime.

dynamic was introduced as part of the DLR (Dynamic Language Runtime) in .Net.

Example:
dynamic d = new MyClass();
d.InexistingMethod();

Eventhough the method "InexistingMethod" is not there - it will get compiled and thrown exception in runtime.

(More...)

What is dynamic variable in java and where do we use them?

  
The variables that are initialized at run time is called as dynamic variable (More...)

What is static linking and dynamic linking library

  
Dynamic linking includes only the information needed at runtime to locate the code for a DLL function but in static linking , the linker gets all of the referenced function from a static library and places into your code. (More...)

What are dynamic objects?

  
Dynamic objects are changed during time of test execution. (More...)

php dynamic og:image for facebook

  
Now this is all over stackoverflow but I haven't come across a solution that has worked yet so here goes...

Just trying to get facebook to recognise my og:image pretty simple. Everything outputs with the facebook object debugger except the thumbnail won't show. It does however show the correct url and when the blank thumbnail is clicked it loads the correct image.


Here that code for that:







(More...)

Difference between Var vs Dynamic?

  
Var word was introduced with C#3.5(specifically for LINQ) while dynamic is introduced in C#4.0.
Variables declared with var keyword will get compiled and you can have all its related methods by intellisense while variables declared with dynamic keyword will never get compiled. All the exceptions related to dynamic type variables can only be caught at runtime. (More...)

difference between Var and Dynamic keyword in c#

  
The Var(Implicit typed local variable) keyword is used to define local variables.In case of Var , the underlying data type is determined at compile time itself based on the initial assignment.Once the initial assignment has been made with Var type , then it will become strongly typed.If you try to store any incompatible value with the Var type it will result in compile time error.

But in Dynamic type, the underlying type is determined only at run time.Dynamic data type is not checked at compile time and also it is not strongly typed.We can assign any initial value for dynamic type and then it can be reassigned to any new value during its life time.

Example:
dynamic test="Senthil";
Console.Writeline(test.GetType()) // System.String

test=1222;
Console.Writeline(test.GetType()) // System.Int32

test=new List();
Console.Writeline(test.GetType()) //System.Collections.Generic.List'1[System.String]

It doesn't provide IntelliSense support also.It doesn't give better support when we give work with linq also.Because it doesn't support lambda expressions ,extension methods and anonymous methods.


Check this blog for more info about var and dynamic:-


senthilvijayalakshmi.blogspot.in/2013/03/difference-between-var-and-dynamic.html (More...)

How the Dynamic works .net 4.0?

  
We are going to see how the Dynamics work in .Net now. For example consider the following statement.

dynamic d=GetSomeData(15); When we execute this statement,Let's see what will happen behind the scenes.

When the above statement executes, the DLR will pass the expression trees to the target object.If the dynamic data type is pointing in memory to a COM object, then the expression tree will be sent to the COM interface named IDispatch. This interface is COM's way of incorporating its own set of dynamic services.

If the dynamic data is not pointing to a COM object, then the expression tree may be passed to the object implementing the IDynamicObject interface.This interface is used to map the expression tree to Ruby specifics in the dynamic languages like Iron Ruby.

If suppose the dynamic data is not pointing to COM object and does not implement IDynamicObject, then the object will be considered as .Net object. In this case the expression tree is sent to the C# run time binder for processing.

After the expression tree has been processed by the given binder, the dynamic data will be resolved to the real in-memory data type after which the correct method is called with any necessary parameters.

To know more about the expression tree basics , please read the following article.

http://www.codeproject.com/Articles/235860/Expression-Tree-Basics

Check this blog for more info about var and dynamic:-

senthilvijayalakshmi.blogspot.in/2013/03/difference-between-var-and-dynamic.html
(More...)

Difference between static and dynamic?

  
Static : we can mention how many things we need.
Dynamic : we cannot mention it generates depends upon the requirements. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend