我受不了了!!!!! doubleValue这个方法在哪里?他的返回值是什么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 double doubleValue() Returns the double value of this Double object. 把double doubleValue()也贴出来 import java.util.*;class Tstack { public static void main(String[] args) { Stack s = new Stack(); Integer a1 = new Integer("123"); s.push(a1); Double a2 = new Double("23.323"); s.push(a2); Double a3 = (Double)s.pop(); double a33 =a3.doubleValue(); Integer a4 = (Integer)s.pop(); double a44 = a4.doubleValue(); double a5 = a33 + a44; System.out.print(a5); }}以上应该是你的程序的本意吧。关键是你把 doubleValue()这个方法用错了;还有,堆栈应该是先弹出这个 Double 吧~~ 这段代码能更深刻帮你理解this吗 如何写这样一个基类? Thread的yield()问题 "restruture".substring(2,3)=? 请问如何计算一个字符串的SHA1-Digest? 只让一个java程序实例运行 有关GC,问个问题 开源项目协同开发!大家参与进来 看不懂这几行代码,高手赐教 JTextArea中文乱码,请问如何解决,给50大洋 菜鸟问题---JTable怎么用? 求助
Returns the double value of this Double object.
{
public static void main(String[] args)
{
Stack s = new Stack();
Integer a1 = new Integer("123");
s.push(a1);
Double a2 = new Double("23.323");
s.push(a2);
Double a3 = (Double)s.pop();
double a33 =a3.doubleValue();
Integer a4 = (Integer)s.pop();
double a44 = a4.doubleValue();
double a5 = a33 + a44;
System.out.print(a5);
}
}
以上应该是你的程序的本意吧。
关键是你把 doubleValue()这个方法用错了;
还有,堆栈应该是先弹出这个 Double 吧~~