Scope of variables in Java

Haider Ali
Java by coding examples
Jan 17, 2024
class P005_Scope
{
public static void main(String args[])
{
{
int i=100;
}

// line below gives the error: can not resolve symbol i
System.out.println(i);
}
}

--

--