1.Which of the following statements about variable scope is true?
A) The same variable name can be used in two differentmethods.B) The same name can be used for two different variables in asingle methodC) you should use global variables whenever possibleD) every variable is visible from the point at which it isdefined until the end of the program
2. Keeping variables in a class inaccessible can be done byusing (fill in blank) keyword.A) privateB) publicC) protectedD) none of the above
Please give explanation if possible, thank you.
Expert Answer
An answer will be send to you shortly. . . . .