SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Downloaden Sie, um offline zu lesen
Primitive Data Types
There are eight primitive data types supported by Java.
Primitive data types are predefined by the language and
named by a key word.
Primitive types are not objects;
so does not have any methods for further processing.
Non Decimal
● byte - signed 8-bit
● short - signed 16-bit
● int - signed 32-bit
● long - signed 64-bit
Decimal
● float - single-precision 32-bit
● double - double-precision 64-bit
boolean
● boolean data type represents one bit of information
● There are only two possible values : true and false.
● Default value is false
char
● 16-bit Unicode character
● Minimum value is ‘u0000′ (or 0).
● Maximum value is ‘uffff’ (or 65,535 inclusive)
Reference Data Types
Reference variables are created using defined
constructors of the classes.
They are used to access objects. These variables are
declared to be of a specific type that cannot be changed.
Java Literals
A literal is a source code representation of a fixed value.
Java language supports few special escape
sequences for String and char literals as well.

Weitere ähnliche Inhalte

Was ist angesagt?

Primitive data types in java
Primitive data types in javaPrimitive data types in java
Primitive data types in javaUmamaheshwariv1
 
Handout for Dublin Core Metadata Initiative Abstract Model
Handout for Dublin Core Metadata Initiative Abstract ModelHandout for Dublin Core Metadata Initiative Abstract Model
Handout for Dublin Core Metadata Initiative Abstract ModelJenn Riley
 
Why Java is not a purely object oriented language?
Why Java is not a purely object oriented language?Why Java is not a purely object oriented language?
Why Java is not a purely object oriented language?NexSoftsys
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variablesteach4uin
 
0x3E9 Ways To DIE
0x3E9 Ways To DIE0x3E9 Ways To DIE
0x3E9 Ways To DIEynvb
 
Python assignment help from professional programmers
Python assignment help from professional programmersPython assignment help from professional programmers
Python assignment help from professional programmersAnderson Silva
 
Primitive data types
Primitive data typesPrimitive data types
Primitive data typesStudent
 
What are variables and keywords in c++
What are variables and keywords in c++What are variables and keywords in c++
What are variables and keywords in c++Abdul Hafeez
 
Doppl development iteration #2
Doppl development   iteration #2Doppl development   iteration #2
Doppl development iteration #2Diego Perini
 
Variables and datatypes in javascript
Variables and datatypes in javascriptVariables and datatypes in javascript
Variables and datatypes in javascriptVivek Kumar
 
Data types and Operators
Data types and OperatorsData types and Operators
Data types and OperatorsMohamed Samy
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++Neeru Mittal
 
C – A Programming Language- I
C – A Programming Language- IC – A Programming Language- I
C – A Programming Language- IGagan Deep
 

Was ist angesagt? (20)

Primitive data types in java
Primitive data types in javaPrimitive data types in java
Primitive data types in java
 
Handout for Dublin Core Metadata Initiative Abstract Model
Handout for Dublin Core Metadata Initiative Abstract ModelHandout for Dublin Core Metadata Initiative Abstract Model
Handout for Dublin Core Metadata Initiative Abstract Model
 
5. variables & data types
5. variables & data types5. variables & data types
5. variables & data types
 
Why Java is not a purely object oriented language?
Why Java is not a purely object oriented language?Why Java is not a purely object oriented language?
Why Java is not a purely object oriented language?
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variables
 
Flow control, variable types
Flow control, variable typesFlow control, variable types
Flow control, variable types
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
0x3E9 Ways To DIE
0x3E9 Ways To DIE0x3E9 Ways To DIE
0x3E9 Ways To DIE
 
Python assignment help from professional programmers
Python assignment help from professional programmersPython assignment help from professional programmers
Python assignment help from professional programmers
 
Python revision tour -I
Python revision tour -IPython revision tour -I
Python revision tour -I
 
C keywords and identifiers
C keywords and identifiersC keywords and identifiers
C keywords and identifiers
 
Primitive data types
Primitive data typesPrimitive data types
Primitive data types
 
What are variables and keywords in c++
What are variables and keywords in c++What are variables and keywords in c++
What are variables and keywords in c++
 
Doppl development iteration #2
Doppl development   iteration #2Doppl development   iteration #2
Doppl development iteration #2
 
Variables and datatypes in javascript
Variables and datatypes in javascriptVariables and datatypes in javascript
Variables and datatypes in javascript
 
Data Types
Data TypesData Types
Data Types
 
Data types and Operators
Data types and OperatorsData types and Operators
Data types and Operators
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++
 
Csc240 -lecture_4
Csc240  -lecture_4Csc240  -lecture_4
Csc240 -lecture_4
 
C – A Programming Language- I
C – A Programming Language- IC – A Programming Language- I
C – A Programming Language- I
 

Andere mochten auch

Java Basic Syntax
Java Basic SyntaxJava Basic Syntax
Java Basic Syntaxjavaicon
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaAjay Sharma
 
K02 ppt brauchen kaufen finden
K02 ppt brauchen kaufen findenK02 ppt brauchen kaufen finden
K02 ppt brauchen kaufen findenjtriepel
 
Manuaccess10
Manuaccess10Manuaccess10
Manuaccess10noemitazz
 
Introducción a Microsoft Access 2003 [parte 3]
Introducción a Microsoft Access 2003 [parte 3]Introducción a Microsoft Access 2003 [parte 3]
Introducción a Microsoft Access 2003 [parte 3]Juan Fco Valero [LION 4K]
 
Kuva-arvoitus
Kuva-arvoitusKuva-arvoitus
Kuva-arvoitusOuLUMA
 
đIểm tk các sở nghành 6 tháng cuối năm
đIểm tk các sở nghành 6 tháng cuối nămđIểm tk các sở nghành 6 tháng cuối năm
đIểm tk các sở nghành 6 tháng cuối nămLà Nắng Anh
 
Manual de SIGMA - Materiales en la IE
Manual de SIGMA - Materiales en la IEManual de SIGMA - Materiales en la IE
Manual de SIGMA - Materiales en la IEWildo Huillca Moyna
 
HCS Contact Center - Driving Customer Experience Excellence with Your Contact...
HCS Contact Center - Driving Customer Experience Excellence with Your Contact...HCS Contact Center - Driving Customer Experience Excellence with Your Contact...
HCS Contact Center - Driving Customer Experience Excellence with Your Contact...Cisco Powered
 
A Greener Office: 5 Things You Can Do to be Kinder to the Environment
A Greener Office: 5 Things You Can Do to be Kinder to the EnvironmentA Greener Office: 5 Things You Can Do to be Kinder to the Environment
A Greener Office: 5 Things You Can Do to be Kinder to the EnvironmentBrightCarbon
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method InvocationPaul Pajo
 

Andere mochten auch (20)

Java Basic Syntax
Java Basic SyntaxJava Basic Syntax
Java Basic Syntax
 
New syntax elements of java 7
New syntax elements of java 7New syntax elements of java 7
New syntax elements of java 7
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
K02 ppt brauchen kaufen finden
K02 ppt brauchen kaufen findenK02 ppt brauchen kaufen finden
K02 ppt brauchen kaufen finden
 
Manuaccess10
Manuaccess10Manuaccess10
Manuaccess10
 
Assetjament escolar: una mirada mediadora. Propostes per a la intervenció. Ne...
Assetjament escolar: una mirada mediadora. Propostes per a la intervenció. Ne...Assetjament escolar: una mirada mediadora. Propostes per a la intervenció. Ne...
Assetjament escolar: una mirada mediadora. Propostes per a la intervenció. Ne...
 
Lighthouse erp® Alchemist Education ERP
Lighthouse erp® Alchemist Education ERPLighthouse erp® Alchemist Education ERP
Lighthouse erp® Alchemist Education ERP
 
Conclusiones del Grupo de Debate 3: Ciberseguridad y Protección de Infraestru...
Conclusiones del Grupo de Debate 3: Ciberseguridad y Protección de Infraestru...Conclusiones del Grupo de Debate 3: Ciberseguridad y Protección de Infraestru...
Conclusiones del Grupo de Debate 3: Ciberseguridad y Protección de Infraestru...
 
Introducción a Microsoft Access 2003 [parte 3]
Introducción a Microsoft Access 2003 [parte 3]Introducción a Microsoft Access 2003 [parte 3]
Introducción a Microsoft Access 2003 [parte 3]
 
Kuva-arvoitus
Kuva-arvoitusKuva-arvoitus
Kuva-arvoitus
 
Presentación de la experiencia de un miembro de EBTIC: SecureKids
Presentación de la experiencia de un miembro de EBTIC: SecureKidsPresentación de la experiencia de un miembro de EBTIC: SecureKids
Presentación de la experiencia de un miembro de EBTIC: SecureKids
 
đIểm tk các sở nghành 6 tháng cuối năm
đIểm tk các sở nghành 6 tháng cuối nămđIểm tk các sở nghành 6 tháng cuối năm
đIểm tk các sở nghành 6 tháng cuối năm
 
Manual de SIGMA - Materiales en la IE
Manual de SIGMA - Materiales en la IEManual de SIGMA - Materiales en la IE
Manual de SIGMA - Materiales en la IE
 
16th ALUMNI LEADERSHIP MASTERCLASS
16th ALUMNI LEADERSHIP MASTERCLASS16th ALUMNI LEADERSHIP MASTERCLASS
16th ALUMNI LEADERSHIP MASTERCLASS
 
Presentación del Programa de Empresas de Base Tecnológica
Presentación del Programa de Empresas de Base TecnológicaPresentación del Programa de Empresas de Base Tecnológica
Presentación del Programa de Empresas de Base Tecnológica
 
HCS Contact Center - Driving Customer Experience Excellence with Your Contact...
HCS Contact Center - Driving Customer Experience Excellence with Your Contact...HCS Contact Center - Driving Customer Experience Excellence with Your Contact...
HCS Contact Center - Driving Customer Experience Excellence with Your Contact...
 
Variable
VariableVariable
Variable
 
Jvm fundamentals
Jvm fundamentalsJvm fundamentals
Jvm fundamentals
 
A Greener Office: 5 Things You Can Do to be Kinder to the Environment
A Greener Office: 5 Things You Can Do to be Kinder to the EnvironmentA Greener Office: 5 Things You Can Do to be Kinder to the Environment
A Greener Office: 5 Things You Can Do to be Kinder to the Environment
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 

Kürzlich hochgeladen

SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 

Kürzlich hochgeladen (20)

SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 

Java basic data types

  • 1. Primitive Data Types There are eight primitive data types supported by Java. Primitive data types are predefined by the language and named by a key word. Primitive types are not objects; so does not have any methods for further processing.
  • 2. Non Decimal ● byte - signed 8-bit ● short - signed 16-bit ● int - signed 32-bit ● long - signed 64-bit
  • 3. Decimal ● float - single-precision 32-bit ● double - double-precision 64-bit
  • 4. boolean ● boolean data type represents one bit of information ● There are only two possible values : true and false. ● Default value is false
  • 5. char ● 16-bit Unicode character ● Minimum value is ‘u0000′ (or 0). ● Maximum value is ‘uffff’ (or 65,535 inclusive)
  • 6. Reference Data Types Reference variables are created using defined constructors of the classes. They are used to access objects. These variables are declared to be of a specific type that cannot be changed.
  • 7. Java Literals A literal is a source code representation of a fixed value.
  • 8. Java language supports few special escape sequences for String and char literals as well.