Variables_in_Java
Variables_in_Java
In Java, variables are containers that hold data that can be manipulated during program
execution. Here's a brief overview:
1. **Local Variables**:
- Declared inside a method, constructor, or block.
- Only accessible within the scope where they are defined.
- Must be initialized before use.
### Examples
```java
public class Example {
// Instance variable
int instanceVar = 10;
// Static variable
static int staticVar = 20;
Understanding these basics about variables in Java is crucial for managing data and writing
effective programs.