SlideShare a Scribd company logo
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.

More Related Content

What's hot

Primitive data types in java
Primitive data types in javaPrimitive data types in java
Primitive data types in java
Umamaheshwariv1
 
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
Jenn Riley
 
5. variables & data types
5. variables & data types5. variables & data types
5. variables & data types
M H Buddhika Ariyaratne
 
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 variables
teach4uin
 
Flow control, variable types
Flow control, variable typesFlow control, variable types
Flow control, variable types
Abraham Marin-Perez
 
Lecture 4
Lecture 4Lecture 4
0x3E9 Ways To DIE
0x3E9 Ways To DIE0x3E9 Ways To DIE
0x3E9 Ways To DIE
ynvb
 
Python assignment help from professional programmers
Python assignment help from professional programmersPython assignment help from professional programmers
Python assignment help from professional programmers
Anderson Silva
 
Python revision tour -I
Python revision tour -IPython revision tour -I
Python revision tour -I
Navodaya Vidyalaya Samiti
 
C keywords and identifiers
C keywords and identifiersC keywords and identifiers
C keywords and identifiers
Akhileshwar Reddy Ankireddy
 
Primitive data types
Primitive data typesPrimitive data types
Primitive data types
Student
 
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 #2
Diego Perini
 
Variables and datatypes in javascript
Variables and datatypes in javascriptVariables and datatypes in javascript
Variables and datatypes in javascript
Vivek Kumar
 
Data Types
Data TypesData Types
Data Types
Vivek Srivastava
 
Data types and Operators
Data types and OperatorsData types and Operators
Data types and Operators
Mohamed 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
 
Csc240 -lecture_4
Csc240  -lecture_4Csc240  -lecture_4
Csc240 -lecture_4
Ainuddin Yousufzai
 
C – A Programming Language- I
C – A Programming Language- IC – A Programming Language- I
C – A Programming Language- I
Gagan Deep
 

What's hot (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
 

Viewers also liked

Web accessibility
Web accessibilityWeb accessibility
Web accessibilityAHoskin
 
Comparison
ComparisonComparison
ComparisonAHoskin
 
Git presentation1
Git presentation1Git presentation1
Git presentation1Git System
 
Videoconferencing: Connect, Communicate and Collaborate
Videoconferencing: Connect, Communicate and CollaborateVideoconferencing: Connect, Communicate and Collaborate
Videoconferencing: Connect, Communicate and Collaboratecynthiafarrell
 
Must Know Web 2.0
Must Know Web 2.0Must Know Web 2.0
Must Know Web 2.0
cynthiafarrell
 
Presentation Tools for the Classroom
Presentation Tools for the ClassroomPresentation Tools for the Classroom
Presentation Tools for the Classroomcynthiafarrell
 

Viewers also liked (6)

Web accessibility
Web accessibilityWeb accessibility
Web accessibility
 
Comparison
ComparisonComparison
Comparison
 
Git presentation1
Git presentation1Git presentation1
Git presentation1
 
Videoconferencing: Connect, Communicate and Collaborate
Videoconferencing: Connect, Communicate and CollaborateVideoconferencing: Connect, Communicate and Collaborate
Videoconferencing: Connect, Communicate and Collaborate
 
Must Know Web 2.0
Must Know Web 2.0Must Know Web 2.0
Must Know Web 2.0
 
Presentation Tools for the Classroom
Presentation Tools for the ClassroomPresentation Tools for the Classroom
Presentation Tools for the Classroom
 

More from Shahid Rasheed

Java Variable Storage
Java Variable StorageJava Variable Storage
Java Variable Storage
Shahid Rasheed
 
Java Instantiation
Java InstantiationJava Instantiation
Java Instantiation
Shahid Rasheed
 
Variable Naming Best Practices
Variable Naming Best PracticesVariable Naming Best Practices
Variable Naming Best Practices
Shahid Rasheed
 
Java Variable Types
Java Variable TypesJava Variable Types
Java Variable Types
Shahid Rasheed
 
Java Basic Operators
Java Basic OperatorsJava Basic Operators
Java Basic Operators
Shahid Rasheed
 
Java basic-syntax
Java basic-syntaxJava basic-syntax
Java basic-syntax
Shahid Rasheed
 
What is-java
What is-javaWhat is-java
What is-java
Shahid Rasheed
 

More from Shahid Rasheed (7)

Java Variable Storage
Java Variable StorageJava Variable Storage
Java Variable Storage
 
Java Instantiation
Java InstantiationJava Instantiation
Java Instantiation
 
Variable Naming Best Practices
Variable Naming Best PracticesVariable Naming Best Practices
Variable Naming Best Practices
 
Java Variable Types
Java Variable TypesJava Variable Types
Java Variable Types
 
Java Basic Operators
Java Basic OperatorsJava Basic Operators
Java Basic Operators
 
Java basic-syntax
Java basic-syntaxJava basic-syntax
Java basic-syntax
 
What is-java
What is-javaWhat is-java
What is-java
 

Recently uploaded

Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 

Recently uploaded (20)

Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 

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.