|
int x = 5; //an
integer (whole number) double x, y; |
How to add two doubles togetherJava's primitive types for numbers include the int type (for whole numbers) and the double type for numbers with decimal places (real numbers). To add two doubles together use the code shown on the left in the actionPerformed method of the AddTwo Class. Be sure to spell correctly, double and Double are different! |
|
Close
this window to return to the previous page |
| Questions or problems related to this web site should be addressed to Richard Jones who asserts his right to be identified as the author and owner of these materials - unless otherwise indicated. Please feel free to use the material presented here and to create links to it for non-commercial purposes; an acknowledgement of the source is required by the Creative Commons licence. Use of materials from this site is conditional upon your having read the additional terms of use on the about page and the Creative Commons Licence. View privacy policy.
© 2001 - 2006 Richard Jones, PO BOX 246, Cambridge, New Zealand; This page was last modified on April 4, 2006 |