Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区 » 实战错误讨论  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:请教string型转实型的问题,急等…… [Re:jimoyh]
cxy19822003





发贴: 8
积分: 0
于 2005-01-17 19:56 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
class Hello{
  
  static String s=new String("10.22d");
  public static void main(String[] args){
    
   try{
      System.out.println(Float.parseFloatMoon);
  
   }
   catch(Exception e){

        System.out.println(e.toString()+"\n"+e.getMessage());
   }
  }
}
上面这个程序它编译和运行都不会有错
再看下面一个,我把10.22d改成10.22q
class Hello{
  
  static String s=new String("10.22d");
  public static void main(String[] args){
    
   try{
      System.out.println(Float.parseFloatMoon);
  
   }
   catch(Exception e){

        System.out.println(e.toString()+"\n"+e.getMessage());
   }
  }
}
编译可以,运行出现如下错误




话题树型展开
人气 标题 作者 字数 发贴时间
36853 请教string型转实型的问题,急等…… jimoyh 119 2005-01-17 16:49
29818 Re:请教string型转实型的问题,急等…… 齐彬 37 2005-01-17 18:56
29779 Re:请教string型转实型的问题,急等…… cxy19822003 631 2005-01-17 19:56
29630 Re:请教string型转实型的问题,急等…… cxy19822003 186 2005-01-17 20:06
29799 Re:请教string型转实型的问题,急等…… cxy19822003 41 2005-01-17 20:09
30367 Re:请教string型转实型的问题,急等…… jimoyh 152 2005-01-18 16:01

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923