Questions tagged [dynamic-binding]

Dynamic binding (aka dynamic dispatch) is the process of mapping a message to a specific piece of code (method) at runtime.

257 questions
-1
votes
1 answer

When multiple variables refer to same python list, and if value of one variable is changed, other variable is also changed autommatically. Why?

I have the below small code in Python where I am changing the value of list_one by using pop() function but I am not doing any changes in list_two. on printing list_one and list_two they both print the same results as mentioned below. arr =…
Puneet
  • 1
-1
votes
2 answers

How to Explain Lexical vs Dynamic Binding?

I read a relevant post on binding, however still have questions. Here are the following examples I found. Can someone tell me if the conclusions are correct? Dynamic Binding of x in (i): (defun j () (let ((x 1)) (i))) (defun i () (+ x…
notaorb
  • 1,944
  • 1
  • 8
  • 18
-1
votes
1 answer

Can Java have dynamic type binding for variables?

Can variables have dynamic type binding in Java? I know that methods can, but I don't think that variables can since every variable has to have a type declaration when it is created such as int, double, or float. If they can, how would that be done?…
ALAB23
  • 33
  • 3
-1
votes
2 answers

How to understand the dynamic binding in this C++ code?

This is my code. I need help making this Dynamic Binding work. #include #include using namespace std; class Shape { protected: double x,y; public: void get_data(double a,double b=3.14) { x=a; …
-1
votes
1 answer

Cannot convert from 'typeA' to 'typeB' when attempting dynamic binding in C#

I'm trying to design an API that is supposed to have a certain method for each of the 20+ concrete classes that I need to support (I can't change those specs). My first idea was to use overloading to have the same method with different parameters…
STT
  • 215
  • 1
  • 11
-1
votes
1 answer

Static/dynamic binding in Java

I do have class Person, class Student and Student extends Person. As far as I understood, it goes the following with static binding: class Person { talk(Person p) { print("Hi by person."); } } class Student extends Person { …
Jush KillaB
  • 151
  • 1
  • 11
-1
votes
1 answer

Dynamic binding and static

I guess i am having some trouble in understanding dynamic bynding. Suppose we are having 2 classes: class a1{ //.. virtual void print() const; }; class a2:a1{ //... void print() const override; }; Why is the following true: a2 item_son; a1…
-1
votes
1 answer

How is dynamic binding performed in java? (I have specific details)

I see some earlier questions similar to this, but I am looking for more specific answers. 1) In this case how/when does or what makes JVM to do perform dynamic binding? I try to call derived class method derivedFunc1() using super class reference…
sql_dummy
  • 715
  • 8
  • 23
-1
votes
2 answers

What is the meaning of the type of reference

class Parent { int m; } class child extends Parent { public static void main(String args[]) { Parent x = new Child(); } } What is the meaning when we say x is of type Parent? Why do we make use of such referencing while we…
-1
votes
1 answer

how do Store data in controller class to save record from form data in jsp

I am using this code to get form data used inside jsp Form. String product=request.getParameter("product"); String qty=request.getParameter("quantity"); String price=request.getParameter("price"); writer.println(product +" "+qty+" "+price); How…
Pritam Tiwari
  • 19
  • 1
  • 3
-1
votes
3 answers

When is it decided which function is to call in case of const and non const reference variable?

Consider the following functions int f (const int& i) { cout << "in const reference function"; } int f ( int &i) { cout << "in non const reference function"; } int main() { int i; f(3); f(i); } In this case when the function call is…
OldSchool
  • 2,123
  • 4
  • 23
  • 45
-1
votes
3 answers

Dynamic method binding

class Shape { public: virtual void draw() = 0; . . . }; class Circle : public Shape { public: void draw() { . . . } . . . }; class Rectangle : public Shape { public: void draw() { . . . } . . . }; class Square : public Rectangle { public: void…
REP ZOM
  • 1
  • 3
-1
votes
1 answer

Inheritance and method overriding in Scala

When we have the following basic classes class X { def f = println("X") } class Y extends X { override def f = println("Y") } val a : X = Y I think I am happy with why we get scala> a.f Y But then I don't understand why we then have scala>…
Bridgo
  • 149
  • 5
-1
votes
3 answers

Dynamic binding in interpreted languages vs compiled languages

So currently reading about binding... Based on the examples I can think of along with examples found on the web, it appears that dynamic binding tends to occur predominantly in interpreted languages as opposed to occurring in compiled languages.…
-1
votes
3 answers

Trying to understand dynamic binding and virtual functions

Given the codes below: class Base { public: virtual void f() { std::cout << "virtual Base::f()\n"; } }; class D1 : public Base { public: virtual void f() { std::cout << "virtual D1::f()\n"; } }; int…
Yue Wang
  • 1,710
  • 3
  • 18
  • 43
1 2 3
17
18