- Basic data types, their uses and limitations
- Abstract data types
This short chapter introduces the basic ‘primitive’—fundamental and in-built—types in Java and discusses their limitations. We also encounter an ‘abstract data type’ as part of the process of specifying additional ones—the structures with which this book is concerned.
2.2 DATA TYPES AND VARIABLES
When a variable is declared in a program, its type defines the kind of data and the range of values that it may contain. All programming languages have some ‘predefined’ data types. Figure 2.1 shows some of these for the Java language.
2.2.1 Operations on integers
Operators for variables of integer type are as follows:
- assignment of values (=) ...