In the following code snippet, what is the scope of variable b?
Public static void m1()
{
Int i = 0;
Double b = 0;
}
Public static void m2()
{
Double a = b + 1;
}
Public static void main(String[] args)
{
M1() ;
M2() ;
}
A) It can be used only in m1.
B) It can be used in user-defined methods m1 and m2.
C) It can be used anywhere in this program.
D) It can be used in many programs.
Correct Answer:
Verified
Q71: Given the following method:
Public static boolean isMagic(int
Q72: Given the following method that checks for
Q73: An effective technique for understanding the subtle
Q74: A temporary method that is used to
Q75: Given the following method, what do we
Q77: Given the following method, what method call
Q78: Which of the following options represents the
Q79: For a program that reads three letter
Q80: What is incorrect in the following code
Q81: What is the output of the following
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents