import java.util.List; class DeclaredOutputVariable { void foo(List a) { String s = a.get(1); if (s == null) return; System.out.println(s.charAt(1)); System.out.println(s.length()); } void bar(List a) { String s = a.get(2); if (s == null) return; System.out.println(s.charAt(2)); System.out.println(s.length()); } }