Chap-5
Chap-5
Fundamentals of Programming
Qs. What is data type? Describe the different data types used in Java.
The data stored in the memory of a computer can be of different types. Data type
represents the kind of data and determines how much memory the data requires and
what kind of operations can be performed on the data. The various data types in Java
are:
e) Primitive Types - The fundamental or basic data types, which are independent of
any other type, are called Primitive data types. In Java the eight predefined
primitive data types are byte, short, int, long, float, double, char, & boolean.
f) Non-Primitive Type - The data types which derived from one or more primitive
data types and have more functions than primitive data types are called Non-
primitive data types. In Java the various Non-primitive data types are class,
array, interface etc.
1
Qs. What is Object?
Object is an instance of a Class. It is an identifiable entity with some characteristics
and behaviours. It combines data and methods into a single unit.