Alex Rivera | Logout

What is the difference between data types and literals in Java?

Asked 2011-01-10T06:50:38.287
37

What is the difference between data types and literals in Java?

Edit
Report

1 Answer

46

From Java Data types tutorial

Data types :

Primitive types are special data types built into the language; they are not objects created from a class

Literal :

A Literal is the source code representation of a fixed value; literals are represented directly in your code without requiring computation

boolean result = true;

boolean - is data type
true - is literal
answered 2011-01-10T07:04:09.777

Your Answer