Define what is the difference between compile-time polymorphism and run-time polymorphism?

1 Answer

Answer :

Compile time Polymorphism Compile time Polymorphism also known as method overloading. Method overloading means having two or more methods with the same name but with different signatures. Run time Polymorphism
Run time Polymorphism also known as method overriding. Method overriding means having two or more methods with the same name, same signature but with a different implementation.

Related questions

Description : Differentiate between run time and compile time polymorphism.

Last Answer : Sr. No. Compile time polymorphism Runtime polymorphism 1 In this polymorphism, an object is bound to its function call at compile time. In this polymorphism, ... is implemented with operator overloading or function overloading It is implemented with virtual function.

Description : Compare run-time and compile-time polymorphism.

Last Answer : Compare run-time and compile-time polymorphism.

Description : Write any four differences between compile time and run time polymorphism.

Last Answer : Sr. No. Compile-time Polymorphism Run-time Polymorphism 1 Compile time polymorphism means that an object is bound to its function call at compile time. Run time polymorphism means that selection ... binding. 7 E.g. overloaded function call. E.g. virtual function.

Description : Define what are the different types of polymorphism?

Last Answer : There are two types of polymorphism. They are: Compile time Polymorphism Run time Polymorphism

Description : Does the size of an array need to be defined at compile time.

Last Answer : No

Description : How to achieve compile time polymorphism explain in detail.

Last Answer : The process of linking of function call to function definition at compile time is called as Compile Time Polymorphism. It can be through Function and operator overloading. Function overloading: The process of defining the ... \n Concatenated String is:"; str1.display(); getch(); }  

Description : What is polymorphism

Last Answer : Polymorphism is the ability to implement the same operation many times. Each derived method implements the operation inherited from the base class in its own way.

Description : Define what are the difference between const and readonly?

Last Answer : A const cannot be static, while readonly can be static. A const need to be declared and initialized at declaration only, while a readonly can be initialized at the declaration or by the code in the ... A const's value is evaluated at design time, while a read-only value is evaluated at runtime.

Description : Define what is the difference between an abstract method & virtual method?

Last Answer : An Abstract method does not provide an implementation and forces overriding to the deriving class (unless the deriving class also an abstract class), whereas the virtual method has an ... abstract method does not provide implementation & forces the derived class to override the method.

Description : Define what is the difference between a class and an Interface?

Last Answer : 1. Abstract classes can have implementations for some of its members, but the interface can't have implementation for any of its members. 2. Interfaces cannot have fields whereas an ... 5. Abstract class members can have access modifiers whereas interface members cannot have access modifiers.

Description : Define what is the main difference between a sub procedure and a function?

Last Answer : Sub procedures do not return a value, while functions do.

Description : Define what is a basic difference between the while loop and do-while loop in C#?

Last Answer : The while loop tests its condition at the beginning, which means that the enclosed set of statements run for zero or more number of times if the condition evaluates to true. The do while loop iterates a set of statements at least once and then checks the condition at the end.

Description : Define what is the difference between Shadowing and Overriding?

Last Answer : Overriding redefines only the implementation while shadowing redefines the whole element. In overriding derived classes can refer the parent class element by using “ME” keyword, but in shadowing you can access it by “MY BASE”.

Description : Define what is the main difference between a sub procedure and a function?

Last Answer : Sub procedures do not return a value, while functions do.

Description : Define what is the difference between CONST and READONLY?

Last Answer : Both are meant for constant values. A const field can only be initialized at the declaration of the field. A read-only field can be initialized either at the declaration or.

Description : Define what is the difference between Array and LinkedList?

Last Answer : The array is a simple sequence of numbers which are not concerned about each other’s positions. they are independent of each other’s positions. adding, removing or modifying any array element is very easy. Compared to arrays, a linked list is a complicated sequence of numbers.

Description : Define what is the difference between console and window application?

Last Answer : A console application, which is designed to run at the command line with no user interface. A Windows application, which is designed to run on a user’s desktop and has a user interface.

Description : Define what is the difference between Array and ArrayList?

Last Answer : An array is a collection of the same type. The size of the array is fixed in its declaration. A linked list is similar to an array but it doesn’t have a limited size.

Description : Define what is the difference between static and instance methods?

Last Answer : A method declared with a static modifier is a static method. A static method does not operate on a specific instance and can only access static members. A method declared without a static modifier is an ... can be explicitly accessed as this. It is an error to refer to this in a static method.

Description : Define what is the difference between break and continue statement?

Last Answer : The break statement is used to terminate the current enclosing loop or conditional statements in which it appears. We have already used the break statement to come out of switch statements. The ... statement stops the current iteration and simply returns control back to the top of the loop.

Description : Define what is the difference between value type and reference type?

Last Answer : 1. Value types are stored on the stack and when a value of a variable is assigned to another variable. 2. Reference types are stored on the heap, and when an assignment between two reference variables occurs.

Description : Define what is the difference between Custom Control and User Control?

Last Answer : Custom Controls have compiled the 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. Can be ... the toolbox and dragged - dropped from it. A User Control is shared among the single application files.

Description : Define what is the difference between string keyword and System. String class?

Last Answer : String keyword is an alias for System. String class. Therefore, the System. String and string keyword are the same, and you can use whichever naming convention you prefer. The String class provides many methods for safely creating, manipulating, and comparing strings.

Description : Define what is the difference between constants, readonly and, static?

Last Answer : 1. Constants: The value can’t be changed. 2. Read-only: The value will be initialized only once from the constructor of the class. 3. Static: Value can be initialized once.

Description : Define what is the difference between Class And Interface?

Last Answer : Class is a logical representation of an object. It is a collection of data and related sub procedures with a definition. The interface is also a class containing methods which are not having any definitions. Class does not support multiple inheritances. But interface can support.

Description : Define what are the difference between Structure and Class?

Last Answer : 1. Structures are value type and Classes are a reference type 2. Structures can not have contractors or destructors. 3. Classes can have both contractors and destructors. 4. Structures do not support Inheritance, while Classes support Inheritance.

Description : Define what is the difference between “out” and “ref” parameters in C#?

Last Answer : “out” parameter can be passed to a method and it need not be initialized whereas “ref” parameter has to be initialized before it is used.

Description : Define what is the difference between “throw ex” and “throw” methods in C#?

Last Answer : “throw ex” will replace the stack trace of the exception with stack trace info of rethrowing point. “throw” will preserve the original stack trace info.

Description : Define what is the difference between “finalize” and “finally” methods in C#?

Last Answer : Finalize – This method is used for garbage collection. So before destroying an object, this method is called as part of the cleanup activity. Finally – This method is used for executing the code irrespective of exception occurred or not.

Description : Define what is the difference between “dispose of” and “finalize” variables in C#?

Last Answer : Dispose of - This method uses interface - IDisposable interface and it will free up both managed and unmanaged codes like - database connection, files, etc. Finalize - This method is called internally ... called explicitly. It is called by the garbage collector and can't be called from the code.

Description : Define what is the difference between “constant” and “read-only” variables in C#?

Last Answer : Const keyword is used for making an entity constant. We cannot modify the value later in the code. Value assigning is mandatory to constant variables. read-only variable value can be changed ... and value to read-only variables can be assigned in the constructor or at the time of declaration.

Description : Explain how to retrieve information from the configuration file at run time. How would you store information in the configuration file at design time?

Last Answer : You must first create an instance of AppSettingsReader to read the configuration file. You can then call the GetValue method to read values represented in the configuration file. To add configuration ... used to retrieve the entry. The value can be changed between executions of the application.

Description : Describe how to use code to retrieve resources at run time.

Last Answer : You must first create an instance of the ResourceManager class that is associated with the assembly that contains the desired resource. You can then use the GetString method to retrieve string resources or the GetObject method to retrieve object resources.

Description : Describe in general terms how to add a control to a form at run time.

Last Answer : You must first declare and instantiate a new instance of the control. Then, you must add the control to the form�s Controls collection. Once the control has been added to the Controls collection, you must manually set properties that govern the control�s position and appearance.

Description : What error will be generated if a space is given between the logical AND operator (&&)? Will it be a compile-time or a run-time error?

Last Answer : Example: if(5>2 & & 6

Description : Does an object need to be made to run main?

Last Answer : No

Description : I understand what the PL/SQL code below is supposed to do, but when I run the code, it won't compile. Can anybody help with why this is so?

Last Answer : answer:PL\SQL really isn’t my thing, but I believe you need something between the first IF statement and the ELSIF. What do you want it to do with the number if it is 50 or 90?

Description : Which among the following definitions are correct: a) Object - Any entity that has state and behavior is known as an object. b) Class - Collection of objects is called class. It is logical entity. c) ... re-usability and is used to achieve run time polymorphism. d) All of the above e) None of These

Last Answer : d) All of the above

Description : What is purpose of Assembly Linker or define SDK Tool in .NET Framework?

Last Answer : Answer: In .NET whole the working should be with the helps of DLLs.So all of Visual Studio .Net compilers gernate assemblies or u can say dll.If we want to create an assembly with ... Studio .Net .This multi file can contain modules that are written in diffrenet langauage in one application.

Description : What does the Initial Catalog parameter define in the connection string?

Last Answer : The database name to connect to. 

Description : Write code to define and use your own custom attribute.

Last Answer : (From MSDN) // cs_attributes_retr.cs using System; [AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple=true)] public class Author : Attribute { public Author(string name) { this.name ... double version; string name; public string GetName() { return name; } }

Description : What does the Initial Catalog parameter define in the connection string?

Last Answer : The database name to connect to.

Description : Define what are the advantages of getting and set properties in C#?

Last Answer : 1. The get property accessor is used to return the property value. 2. The set property accessor is used to assign a new value.

Description : Define what is a New modifier?

Last Answer : The new modifier hides a member of the base class. C# supports only hide by signature.

Description : Define what is the Static Method?

Last Answer : It is possible to declare a method as Static provided that they don’t attempt to access any instance data or other instance methods.

Description : Define what are sealed classes in c#?

Last Answer : The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another class.

Description : Define what is the syntax to inherit from a class in C#?

Last Answer : When a class is derived from another class, then the members of the base class become the members of the derived class. The access modifier used while accessing members of the base class specifies ... syntax to inherit a class from another class In C# is as follows: class MyNewClass : MyBaseClass

Description : Define what is a static member?

Last Answer : The member defined as static which can be invoked directly from the class level, rather than from its instance.

Description : Define what Command is used to implement properties in C#?

Last Answer : get & set access modifiers are used to implement properties in c#.

Description : Define what is Generic?

Last Answer : 1. Generic help us to create flexible strong type collection. 2. Generic basically separate the logic from the datatype in order to maintain better reusability, better maintainability, etc.