
-----------------------------------
Homer_simpson
Fri Feb 13, 2004 11:33 pm

Double operators
-----------------------------------
is there a way to add and subtract doubles?

-----------------------------------
Paul
Fri Feb 13, 2004 11:36 pm


-----------------------------------
double IS a kind of variable right? I dunno, cause thats the only way I've seen it. So, I hope Im not making a fool of myself here, but don't you just use JOptionPane.showInputDialog, take strings, put them in variables, then use Double.parseDouble, and put them strings into new variables, and subtract them? or add them? I dunno... if you wanted to user input the doubles, you could use it.

-----------------------------------
wtd
Fri Feb 13, 2004 11:38 pm


-----------------------------------
import java.lang.*;
import java.io.*;

class TestDoubleOps
{
   public static void main(String[] args)
   {
      double d = 7.2;
      d = d - 2.5;
      d = d + 3.4;
   }
}

-----------------------------------
Homer_simpson
Sat Feb 14, 2004 2:30 am


-----------------------------------
i mean Doubles not doubles..

-----------------------------------
wtd
Sat Feb 14, 2004 5:06 am


-----------------------------------
The Sun Java API documentation is your friend.

http://java.sun.com/j2se/1.4.2/docs/api/
