You are on page 1of 1

WEEK 2: DATA TYPES AND OPERATORS

Introduction to Data types and Operators


The foundation of any programming language are its data types and
operators. These elements define the limits of a language and determine the
kind of tasks to which it can be applied. Fortunately, Java supports both data
types and operators, making it suitable for any type of programming. The
objective of a Java program is to manipulate data. Different programs manipulate
different data.
A data type defines a set of values and the operations that can be defined
on those values. An operator is a symbol that tells the compiler to perform a specific
mathematical or logical manipulation. Java has four general classes of operators: arithmetic, bitwise,
relational and logical operators.

Data Types
Java supports the use of variables to store data in memory. There are two major types of
variables in Java namely: Primitives and Complex objects variables.
Primitive variables are stored in the fastest possible memory but there’s a small number of data
types that can be stored this way. Primitive variables include:
1. Numeric values: Integers, floating point decimal
2. Single characters (Not complete strings)
3. Boolean values (True/False)
Complex objects variables are defined as an instance of a Java class. This
include Strings, Dates and everything else you might want to work with.

You might also like