为啥编译有错

yuyu123 2003-08-19 11:04:35
public class test
{
public static void main(String[] args)
{
String s1 = "电脑世界";
String s2 = new String(s1.getBytes("ISO-8859-1"),"GBK");
System.out.println(s2);
}
}
...全文
96 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuyu123 2003-08-19
  • 打赏
  • 举报
回复
怎么给分,怎么得分??
scbb 2003-08-19
  • 打赏
  • 举报
回复
public class test
{
public static void main(String[] args)
{
String s1 = "电脑世界";
try {
String s2 = new String(s1.getBytes("ISO-8859-1"),"GBK");
System.out.println(s2);
} catch (java.io.UnsupportedEncodingException e) {

}
}
}

这是技术问题, 记得下此给分发贴。
并且把你的编译错误一起贴上来。

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧