编程语言中绑定的非常简化的概念

从根本上讲,绑定是通过显式声明或隐式声明将一事物分配给另一事物,通常是将值赋给变量。 对于编程新手来说,显式和隐式声明这些术语似乎并不令人望而生畏。 显式声明仅表示定义变量名称及其类型的语句,例如

public int i;

而在隐式中,实现默认约定,例如

int i;

它假定它是公开的。 捆绑整数a,b = 0;变量可以在运行时或在编译时发生,当它在运行时发生时,变量的当前状态会因为为其分配了一个值而发生更改。 例如

int a, b = 0, c;
    for(a = 0; a < 10; a++){
        b+=c;
    }

的状态C Changes as values are been added as the 对于 loop is being exeCuted。 绑定类型 DynamiC Binding:变量根据指定的值绑定到类型。 this happens at run-time。 StatiC Binding : This happens at Compile time where the Compiler figures out what variable to assign to what method or funCtion。 一种 perfeCt example is method overloading where two methods have same name but different number or type of parameter。 If two parameters are passed in a method 一种 (that has two parameters), the Compiler figures out that the method to return is 一种。 Hope this helps。

from: https://dev.to//odigietony/the-very-simplified-concept-of-binding-in-programming-languages-op

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值