Originally posted by sumaraghavi ragha:
what is the difference between a primitive and a literal?
One can't really say what "the difference" is, because they are not closely-enough related concepts. It's like asking what's the difference between a bus and a dog.
The
word "primitive" applies to the subset of Java data types that don't involve objects. This is a concept specific to the Java language.
The word "literal" means a piece of data, such as a number or a text string, that is fixed and hard-coded into your program source code. The word "literal" has about the same meaning in most programming languages.
[ June 11, 2008: Message edited by: Peter Chase ]