Results 1 to 4 of 4
Thread: What does the letters mean?
- 02-09-2010, 10:47 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 33
- Rep Power
- 0
What does the letters mean?
int this code:
what does the letters 'D' do ?Java Code:Item(String idIn, String nameIn, String retailIn, String quantityIn, boolean noDiscountIn) { id = idIn; name = nameIn; retail = Double.parseDouble(retailIn); quantity = Integer.parseInt(quantityIn); noDiscount = noDiscountIn; if (noDiscount == true) price = retail; else if (quantity > 400 || noDiscount == false) price = retail * .5D; else if (quantity > 200 || noDiscount == false) price = retail * .6D; else if ( noDiscount == false) price = retail * .7D; price = Math.floor(price * 100 + .5) / 100;
- 02-09-2010, 11:50 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
> what does the letters 'D' do ?
D tells the compiler that you mean 0.5 as a double value, not a float.
See, for instance, Data Types in Oracle's Java Tutorial.
- 02-11-2010, 09:35 PM #3
Member
- Join Date
- Dec 2009
- Posts
- 33
- Rep Power
- 0
okay thanks
::)
- 02-11-2010, 09:50 PM #4
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Similar Threads
-
converting letters to numbers
By fenhoff in forum New To JavaReplies: 2Last Post: 01-24-2010, 04:45 AM -
Need help with counting letters
By mrdestroy in forum New To JavaReplies: 15Last Post: 10-22-2008, 01:33 PM -
Letter with Letters
By elgatoboricua in forum New To JavaReplies: 7Last Post: 09-16-2008, 02:59 PM -
need block letters??
By dc2acgsr99 in forum New To JavaReplies: 16Last Post: 01-29-2008, 08:31 AM -
adjacent repeating letters
By artemis_r2 in forum New To JavaReplies: 1Last Post: 11-17-2007, 04:48 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks