[Logo]
Forums Register Login
Basic Question
Is there any difference between floating point literal and primitive floating point(primitive and literal)
Thanks in Advance,
Rama
A 'literal' is a value that actually appears in the source code; a character literal looks like 'a', a String literal like "Hello", and a floating-point literal like 123.23 . The word "primitive" refers to a datatype that's not an object; there are only a few primitive types in Java (byte, char, short, int, long, float, and double.)
So the question of what's the difference isn't really a meaningful one. All floats and doubles are primitives; a literal float or double can appear in your source code.
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS


This thread has been viewed 543 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 22, 2018 19:31:36.