NeerajCurator
What is a global and local variable in Java?
What is a global and local variable in Java?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
Local variables are declared within specific blocks of code and have limited scope, existing only within their block. Global variables, declared outside of any function, are accessible from any part of the program and persist throughout its execution.