Skip to content

Instantly share code, notes, and snippets.

@Nan-Zhang
Created March 1, 2014 23:47
Show Gist options
  • Save Nan-Zhang/9299497 to your computer and use it in GitHub Desktop.
Save Nan-Zhang/9299497 to your computer and use it in GitHub Desktop.
The scope for static and local variables in Java
TreeNode prev = null;
public void inorder(TreeNode root, ArrayList<TreeNode> t, TreeNode prev) {
//do sth with prev (Note: this prev is the local variable, and has nothing to do with the static prev)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment