Java新手的问题 看java大学教程(java how to program)或者java程序设计教程(programming with java) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的第二个程序的input变量定义在循环里面,要报错,作用域不同 Double a=3.6;和Double a=new Double(3.6);好像 Double a=3.6是不允许的表达式吧。 import javax.swing.*;public class toTestInteger{ public static void main(String args[]) { String input=null; try{ do { input=JOptionPane.showInputDialog // ("Please enter a number:"); int convertedInput=Integer.parseInt(input); String inputInBase2=Integer.toBinaryString(convertedInput); System.out.println(inputInBase2); System.out.println(Integer.toString(convertedInput)); System.out.println(Integer.toHexString(convertedInput)); System.out.println(Integer.toOctalString(convertedInput)); input=JOptionPane.showInputDialog ("Do you want to exit?(Y/N)"); input=input.toUpperCase( ); } while(input.equals("N")); }catch(NumberFormatException e){} System.exit(0); }} Double a=3.6;是变量初始化,Double a=new Double(3.6);是创建了一个对象a,值为3.6 read的阻塞怎么解决??? 取的java list里前5条数据 求教一个问题的思路,高分相送,急急急!!!!!!!!!! 被混淆编译之后的类,有没有办法再反编译那? Java版传奇发布测试版。 可以下载试玩了, 绝非广告。 多线程异步调用问题 如何在jbuilder7里调试这个简单例子 package问题 哪位仁兄做过多媒体,给我一点建议,答者有分! 空指针异常如何处理 JFrame弹出窗口 小程序 急 在线等
好像 Double a=3.6是不允许的表达式吧。
public class toTestInteger
{ public static void main(String args[])
{ String input=null;
try{ do
{ input=JOptionPane.showInputDialog //
("Please enter a number:");
int convertedInput=Integer.parseInt(input);
String inputInBase2=Integer.toBinaryString(convertedInput);
System.out.println(inputInBase2);
System.out.println(Integer.toString(convertedInput));
System.out.println(Integer.toHexString(convertedInput));
System.out.println(Integer.toOctalString(convertedInput));
input=JOptionPane.showInputDialog
("Do you want to exit?(Y/N)");
input=input.toUpperCase( );
}
while(input.equals("N"));
}catch(NumberFormatException e){}
System.exit(0);
}
}
Double a=3.6;是变量初始化,Double a=new Double(3.6);是创建了一个对象a,值为3.6