Solved

In the Following Code Snippet, What Is the Scope of Variable

Question 76

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents