Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

JAVA PROGRAMMING

The document outlines data types in Java, categorizing them into primitive and reference data types. Primitive data types include int, byte, short, long, float, double, char, and boolean, each with specific characteristics and ranges. Reference data types are used to refer to objects and store memory addresses, with classes serving as blueprints for creating these objects.

Uploaded by

piousirungu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

JAVA PROGRAMMING

The document outlines data types in Java, categorizing them into primitive and reference data types. Primitive data types include int, byte, short, long, float, double, char, and boolean, each with specific characteristics and ranges. Reference data types are used to refer to objects and store memory addresses, with classes serving as blueprints for creating these objects.

Uploaded by

piousirungu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Data Types.

 Primitive data types


 Reference data types

i. Primitive data types.


 Basic data types built in java programming.
a) Int: represents integer values. E.g. Int age = 25;
b) Byte: a small integer(8bit). Ranges from {-128 to 127}. E.g. byte b = 100
c) Short: a 16 bit integer. Ranges from -32,768 to 32,767
d) Long: a 64 bit integer. Ranges from -2147483648 to 2147483647 [L or l]
e) Float: Single precision 32 bit floating point. [F or f]
f) Double: Double precision 64 bit floating point. ( default).- for higher precision.
g) Char: a single 16 bit Unicode character. E.g. char c = ‘A’;
h) Boolean: represents true or false values. E.g. Boolean isJavaFun = true;

ii. Reference data types.


 Used to refer to objects. They store reference or memory addresses to the actual data.
a) Classes.
 A blueprint for creating objects.

You might also like