Answer:
Option(a) is the correct answer for the given question.
Step-by-step explanation:
If we declared a variable with the same name in class and method both then the variable which is declared inside the method overrides the definition of variable which is declared in class .It means the variable which is used inside the method takes precedence.
For example:
public class Main
{
int c=90; // class varaible or instance varaible
void sum1()
{
int c=4; // method having same name as class varaible name
c=c+10;
System.out.println(c);
}
public static void main(String[] args)
{
Main ob=new Main();
ob.sum1();
}
}
Output:
14
In this example the variable 'c' is declared in both class and function but variable c takes the precedence inside the method sum1() and display 14.