public void test (){
String result;
try {
result = JsonUtils.object2Json(map);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(result);
}
为啥红色的result引用不到了呢
------解决思路----------------------
public void test (){
String result; //改为String result = null;
try {
result = JsonUtils.object2Json(map);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(result);
}
------解决思路----------------------
你引用了未初始化的变量!