O'Reilly logo

Introducing Data Structures with Java by David Cousins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2

Data Types

Contents

  • Basic data types, their uses and limitations
  • Abstract data types
2.1 INTRODUCTION

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 (=) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required