public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859_1");
String temp=new String(temp_t);
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859_1");
String temp=new String(temp_t);
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
博客展示了一段Java代码,定义了getStr方法,尝试将传入的字符串按ISO8859_1编码转换为字节数组,再转换回字符串,过程中捕获异常并打印堆栈信息,最终返回null。
5390

被折叠的 条评论
为什么被折叠?



