I am trying to visualize the scope of the variables in a given Java program. How can I name each scope between “{” “}”? i.e. i wanted to display the variables or objects in a tree structure by seeing which a programmer will know the scope of variable or object easily.
I have written a program to calculate the “{” “}” and whether a conditional statement or looping statement occurs on a single line, without any “{” “}”.
My question is! is there already any other tool or concept to do the same or we have write on our own. I am sorry i dont know how to put it more clear.
I am trying to visualize the scope of the variables in a given Java
Share
You can name the scopes whatever you want. If you want to do this in code you can add labels to them.
You can’t declare variables in a stand alone statement (without a
{}) The only exception if for/for-each loops which declare variables.