Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Indicate when each of the following bindings takes place in Java (language desig

ID: 3592286 • Letter: I

Question

Indicate when each of the following bindings takes place in Java (language design time, language implementation time, compile time, link time, load time, or runtime). If more than one time is possible, choose the latest possible time.

(a) Binding of the long type to a specific number of bytes (i.e., the decision to use a specific number of bytes to store a long value)

(b) Binding of the int type to a specific set of values

(c) Binding of a String literal declared inside a method to a specific memory address

(d) Binding of a named array variable to a specific number of dimensions

(e) Binding of an operator to a specific number of operands

Explanation / Answer

(a) Binding of the long type to a specific number of bytes - This is done at the language design time. Java is designed to have long primitive data type to have 64 bits or 8 Bytes.

(b) Binding of the int type to a specific set of values - This is done at compile time. For example if we have a statement like: int x = 20; , then the variable x will be bound to value 20 at the time of compiling.

(c) Binding of a String literal declared inside a method to a specific memory address - This is done at runtime. Memory is allocated to the variables at runtime.

(d) Binding of a named array variable to a specific number of dimensions - This is also done at runtime. Dynamic sized arrays also possible in java; in that case also memory allocation and dimension binding is done at run time.