Global vs local variables in Java
java
dev.to
When you write Java code, every variable has a home — a place where it lives and can be used. That home is called its scope. Today we'll learn about two kinds of variable homes: global and local. Local variable — lives inside a method A local variable is created inside a method. It only exists while that method is running. Once the method finishes, the variable disappears. Think of it like this: A local variable is like a sticky note you write during a meeting. Once the meeting ends