Multiple choice technology programming languages

A variable which is declared inside a method is called a________variable

  1. Serial

  2. Local

  3. Private

  4. Static

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Variables declared inside a method are called local variables because they are only accessible within that method's scope. They are created when the method is called and destroyed when it exits. Private and static variables are declared at class level, while 'serial' is not a standard variable scope term.