1)Define “Static Binding” and “Dynamic Binding” in programming languages. 2)When
ID: 3731500 • Letter: 1
Question
1)Define “Static Binding” and “Dynamic Binding” in programming languages.
2)When does functional side effects (side effect of a function) occur? Give an example.
3)How can you create a dangling pointer?
4)What is “Orthogonality” in programming languages? How does it influence a programing language?
5)Consider the following C program:
int fun (int *i){
*I +=4;
return 5;
}
void main (){
int x=4;
x=3*x+ fun(&x);
}
What is the value of x after the assignment statement in main? Assuming:
A) Operands are evaluated left to right.
B) Operands are evaluated right to left.
6)What do the “operator associativity rules” for expression evaluation define?
7)Can static variables be used in recursive functions? If not, describe why.
Use a simple recursive function as an example to explain your answer.
8)What is an “Access function”? When is this function computed?
9)Name four criteria for evaluating programming languages and briefly explain each one.
10)What are the impacts of
“control structure having multiple entries” and
“control structure having multiple exits”
on programs readability?
Explanation / Answer
If you post more than 1 question, as per chegg guidelines I have to solve only fist question.
Ques 1.
Static Binding is the binding that is resolved at the compile time. It is done by the compiler. All the static, final and private methods are binded at the compile time. The performance of static binding is better than dynamic binding as these methods can't be overriden and they can be accessed by the local class object.
Dynamic Binding is a type of binding where the method to be called is not decided by the compiler. An example of this is method overriding. It is not known at the compile time which class method will be called. It is known at the run time.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.