Variable Hiding in Java

Variable hiding happens when there is another variable with the same name and it has nearest scope. Ex: When local and global variables have the same name, local variables will take precedence than global variables. Consider the below program 1 2 3 4 5 6 7 8 9 10 11 12 package com.kb.javainsimpleway.variable.hiding;   public […]

Share this article on