English

Where are local variables declared in Java?

Advertisements

Question

Where are local variables declared in Java?

Very Short Answer
Advertisements

Solution

In Java, local variables are declared inside a method, constructor, or block of code. They can be accessed and used only within the method or block in which they are declared.

shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Variables and Expressions - SHORT ASSIGNMENTS [Page 136]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 6 Variables and Expressions
SHORT ASSIGNMENTS | Q 30. | Page 136
Advertisements
Share
Notifications



      Forgot password?
Use app×