Java Datatypes
Java has several types of data with which it can deal. They are placed into two categories: Primitive types and reference types.
Primitive Java Types
Java provides eight primitive data types that can be used to store data. These types are boolean, byte, short, int, long, char, float, and double.
Boolean
Boolean data types are the simplest form of datatypes. Variables of this type can store two possible values: true or false. Boolean variables are generally used to store information that is binary. For example, a product can be available or not available.
boolean coffee_available = true;
The previous example sets a boolean variable to true.
Integer
Integer data can be stored in several types based on the value you are attempting ...
Get e-Commerce Applications Using Oracle8i and Java from Scratch now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.