package javaBasic; public class Variables { public static void main(String[] args) { // TODO Auto-generated method stub //Que.5:Define the local and Global variables with the same name and print both variables and understand the scope of the variables /*Example of Local Variable public int add(){ int a =4; int b=5; return a+b; } Here, 'a' and 'b' are local variables*/ /* Example of Global Variable int a =4; int b=5; public int add(){ return a+b; } //Here, 'a' and 'b' are global variables. */ } }