Question: (16). You can declare two variables with the same name as long as___ a. they appear within the same block b. they are assigned different
(16). You can declare two variables with the same name as long as___
a. they appear within the same block
b. they are assigned different values
c. they are of different types
d. their scopes do not overlap
(17). If a method is written to receive a double argument, and you pass an integer to the method, then the method will___
a. work correctly; the integer will be promoted to a double
b. work correctly; the integer will remain an integer
c. execute; but any output will be incorrect
d. not work; an error message will be issued
(18). Methods with the same name that have identical argument lists but different return types are___
a. legal
b. overloaded
c. unstructured
d. illegal
(19). The this reference specifies which ___ you are referencing.
a. method
b. object
c. class
d. program
(20). If you change the value of a static variable in a class, it is changed for___
a. only new objects instantiated after the change
b. only objects already in existence before the change
c. all objects of the class
d. no objects of the class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
