#63 Polymorphism-C#

Polymorphism: Takes Many Forms.


1.Compile Time-(Early Binding/Overloading):Methods can have same name,with different number of arguments.

2.Run Time-(Late Binding/dynamic):Objects of Base Class can Point to objects of Derived class At Runtime.(using Override)

#25:What is CLS ?

Common Language Specification: A Specification,which every language must definitely support and should be kept same across different languages.The intention is that you must be able to communicate between different languages.

Example: For Instance  class in VB,should be able to inherit from Class in C#.Here Inheritance is Common between two languages.Thus CLS is a way of defining minimal support across various languages.

#24 What is CTS ?

Common Type System:A set of standard that defines how data has to be mapped into memory.For instance data can be value type or memory type,data type can be int,float,long,decimal. Languages that Utilizes CLR,should expose the data types as defined by CTS.

Example:Let’s assume you want writing language called xyz.and you utilize CLR feature,and your data type has to map to either Value Type or Memory Type.You cannot define a new type called valuememory type and this will not be supported by CLR as it’s not defined in CTS.

#23: What is JIT?

Just In Time Compiler: A Compiler responsible for Converting IL Code to Native CPU Instructions.

Note: JIT Compiles the IL Code only once,when you execute the program For the first time.The next time when the program is executed ,the JIT does not compile,but instead the call goes directly to memory(since there was no change in IL Code,and the instructions has already been generated during the First time compilation,there is no need for JIT to compile the same old IL Code). 

NGEN.EXE: Tool Available for converting IL Code to Native CPU Instructions.It increases Performance of Applications.It does not utilize JIT.