6.11 Q3: Which of these statements best defines scope?
a. Scope refers to the classes that have access to a variable.
b. Scope determines whether a variable’s value can be altered.
c. Scope is the portion of a program that can refer to an entity by its simple name.
d. Scope allows the programmer to use a class without using its fully qualified name.
6.12 Q1: Overloaded methods always have the same _________.
a. method name
b. return type
c. number of parameters
d. order of the parameters
6.12 Q2: An overloaded method is one that ________.
a. has a different name than another method, but the same parameters
b. has the same name as another method, but different parameters (by number, types or order of the
types)
c. has the same name and parameters as a method defined in another class
d. has the same name and parameters, but a different return type as another method
6.12 Q3: Which of the following methods are overloaded with respect to one another?
public int max (int a, int b) { … }
public double max (double a, double b) { … }
public int max (int a, int b, int c) { … }
public double max (double a, double b, double c) { … }
a. A and B are overloaded; C and D are overloaded.
b. A and C are overloaded; B and D are overloaded.
c. A, B and C are overloaded.
d. All four methods are overloaded.
6.12 Q4: A Java class can have which of the following methods?
A. void foo(int a)
B. void foo(int a, int b)
C. void foo(double a)
D. void foo(double a, double b)
E. void foo(int b)
a. All of the above.
b. A, B, D, E.
c. A, B, C, D.
d. A, C, D, E.