有没有办法用快捷方式将变量拉到try-catch块之外?例如:
从:
try{
AbstractList<Type> t1 = new ArrayList<Type>();
} catch (Exception e) {
...
}
Run Code Online (Sandbox Code Playgroud)
至
AbstractList<Type> t1;
try{
t1 = new ArrayList<Type>();
} catch (Exception e) {
...
}
Run Code Online (Sandbox Code Playgroud)