What mean L or D ( 12D or 100L )

What mean L or D ( 12D or 100L )?

How can convert that in decimal numbers ?
LVL 9
ginsonicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

shuzhangCommented:
L, long
D, double

0
SteveDonieCommented:
Long is longer than an int - in Java an int is always 32 bits, and a long is 64 bits. Double is a floating point type, and again you can have a 32 bit float or a 64 bit double.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ginsonicAuthor Commented:
Whay I need a double value to assign 12 for exmple ? An Integer is ok I think .

I see in some codes 12D or 10D or 0.978D
And 856558L .
0
SteveDonieCommented:
They only reason you might need 12D is in an expression that has other doubles. It really depends on the math you are doing. If the math can be done with just integers, that is great (integer math is usually faster than floating point). But if you have to go to floating point, it then depends on the application. If you're just doing money, use floats. If you're doing something that requires a lot of decimal precision, you might have to go to doubles. Sometimes you'll also have to use double because that is how someone else's method is written.

As far as long vs. int, there the difference is in how large a number you can represent. A 32 bit int can represent numbers from -2,147,483,648 to 2,147,483,647. A 64 bit long can have a max value of 9,223,372,036,854,775,807 (that is a big number!)

So it just depends on what kind of thing you are doing. If you are just keeping track of something that goes up to 100, it is just a waste of space to use a long. You might think it is also wasteful to use an int for that, but you also have to think about the default size on the platform(s) you are targeting.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.