Download - 1 java - data type

Transcript
Page 1: 1  java - data type

Java – Data Type

Organized By: Vinay Arora

Assistant Professor

CSED, Thapar University

www.slideshare.net/aroravinay

Page 2: 1  java - data type

Vinay AroraCSED

Data type/s for the variable/s

Variables are nothing but reserved memory locations to store values.

This means that when you create a variable you reserve some space in memory.

Based on the data type of a variable, the operating system allocates memory and decides what can be stored in the reserved memory.

There are two data types available in Java:Primitive Data TypesReference/Object Data Types

Page 3: 1  java - data type

Vinay AroraCSED

Primitive Data Types

There are eight primitive data types supported by Java. Primitive data types are predefined by the language and named by a keyword.

Byte Short Int Long Float Double Boolean Char

Page 4: 1  java - data type

Vinay AroraCSED

Primitive Data Types (Conti…)

Page 5: 1  java - data type

Vinay AroraCSED

Primitive Data Types (Conti…)

Page 6: 1  java - data type

Vinay AroraCSED

Primitive Data Types (Conti…)

Page 7: 1  java - data type

Vinay AroraCSED

Primitive Data Types (Conti…)

Page 8: 1  java - data type

Vinay AroraCSED

Primitive Data Types (Conti…)

Page 9: 1  java - data type

Vinay AroraCSED

Reference Data Type

Page 10: 1  java - data type

Vinay AroraCSED

Java Literals

Page 11: 1  java - data type

Vinay AroraCSED

Thnx…


Top Related