17.what is the static parent of a subprogram?
ANS: Static chains are primary method of implementing accesses to
non-local variables in static-scoped languages with nested
subprogram. Static chain is a chain of static links that connects
certain activation record instances. The static chain from an
activation record instance connect it to all of its static
ancestors. The static link in an activation record instance for
subprogram A points to one of the activation record instances of
A's static Parent.
18.what is a formal parameter?
The identifier used in a method to stand for the value that is
passed into the method by a caller.
19. int x;
void f(int a){a=a+2; x=x+1;}
void main(){
x=1;
f(x); printf("x=%\n",x)
}
what value of x will be printed by the main program under each of
the following conditions?Imagine that formal parameter a of
function f is being passed
ANS:
by value: x=1
by value result: x=3
by reference: x=2
(17) (1 mark) What is the static parent of a subprogram? (18) (1 mark) What is...
1. What is the output when you run printIn()? public static void main(String[] args) { if (true) { int num = 1; if (num > 0) { num++; } } int num = 1; addOne(num); num = num - 1 System.out.println(num); } public void addOne(int num) { num = num + 1; } 2. When creating an array for primitive data types, the default values are: a. Numeric type b. Char type c. Boolean type d. String type e. Float...