SlideShare a Scribd company logo
1 of 15
Visit our website for free course @ https://www.brainsmartlabs.com/free-basics
Data Types In Java
INDEX
01
02
03
04
Introduction to
Brainsmartlabs
What is data type in Java?
Data types with examples
Contact us
Welcome!!
We are providing the best Java and SQL
tutorial videos for beginners who want to
learn Java in detail. Here we are
explained data types which is a part of
java course. Kindly visit our website and
watch our videos for more info @
https://www.brainsmartlabs.com/
What is data type?
In computer programming, a data type is an attribute of data which
indicates the compiler or interpreter how the programmer expects
to use the data.
There are three types:
1. Primitive types  byte, short, int, long, float, double, char
2. Derived types  Arrays
3. User-defined types  class, sub class, abstract class, interface,
enumeration and annotation.
Primitive Data Types
Primitive data types
Numeric Types Non-Numeric Types
Integer Types
(Whole numbers)
Floating Point Types
(Decimal numbers)
• Byte – 8 bit
• short – 16 bit
• int – 32 bit
• long – 64 bit
• float – 32 bit
• double – 64 bit
Char
8bit
Boolean
True - or- false
Numeric Types
The numeric types has divided into two types.
Integer types: Positive, negative, Whole numbers and without decimal
Floating point types: With decimal, numbers with fractional part
Integer Types
Byte: The byte is an 8-bit signed two's complement integer. It has a minimum
value of -128 and a maximum value of 127.
For Example:
byte myNum = 120;
System.out.println(myNum);
Short: It can store whole numbers from -32768 to 32767.
For Example:
short myNum = 5002;
System.out.println(myNum);
Integer Types
int: It can store whole numbers from -2147483648 to 2147483647.
For Example:
int myNum = 200000;
System.out.println(myNum);
long: The long data type can store whole numbers from -9223372036854775
808 to 9223372036854775808.
For Example:
long myNum = 20000000000L;
System.out.println(myNum);
Floating Point Types
float: It can store fractional numbers from 3.4e−038 to 3.4e+038. Should end
with “f”.
For Example:
float myNum = 3.75f;
System.out.println(myNum);
Double: The double data type can store fractional numbers from 1.7e−308 to
1.7e+038. Should end with “d”.
For Example:
double myNum = 17.99d;
System.out.println(myNum);
Non Primitive DataTypes
Booleans: A Boolean data type is declared with the boolean keyword. It only t
akes the values true or false.
For Example:
boolean iscat = true;
boolean isFish = false;
System.out.println(iscat);
System.out.println(isFishTasty);
Non Primitive Data Types
char: It is used to store a single character. A char value must be enclosed by
single quotes, like 'A' or 'B'.
For Example:
char myGrade = 'C';
System.out.println(myGrade);
Who we are?
Brainsmartlabs.com is one of the best online platform where easily can learn Java
and SQL courses online for free. Here you will learn the free basics first and then
get into the core subject of Java and SQL language. Brain Smart Labs is
one such platform which makes learning easier and affordable with n number of
videos for free and paid. Our videos will not make you bored as our trainer follows
a unique way of teaching with tasks, DIY, tricky questions for each and very videos.
Also, SQL and Java beginners can start their tutorials from the basic with free
videos. You can easily start your advanced SQL tutorial with examples with us.
Contact Us
support@brainsmartlabs.com
(+91) 80958 38383
https://www.brainsmartlabs.com/
@ https://www.youtube.com/c/BrainSmartLabs
Thank you
Hope useful!

More Related Content

What's hot

Java Data Types and Variables
Java Data Types and VariablesJava Data Types and Variables
Java Data Types and Variablessasi saseenthiran
 
Data types in C language
Data types in C languageData types in C language
Data types in C languagekashyap399
 
Java basic datatypes
Java basic datatypesJava basic datatypes
Java basic datatypesSoba Arjun
 
Constant a,variables and data types
Constant a,variables and data typesConstant a,variables and data types
Constant a,variables and data typesmithilesh kumar
 
DATATYPE IN C# CSHARP.net
DATATYPE IN C# CSHARP.netDATATYPE IN C# CSHARP.net
DATATYPE IN C# CSHARP.netSireesh K
 
ITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaAtul Sehdev
 

What's hot (8)

#_ varible function
#_ varible function #_ varible function
#_ varible function
 
Java Data Types and Variables
Java Data Types and VariablesJava Data Types and Variables
Java Data Types and Variables
 
Welcome
WelcomeWelcome
Welcome
 
Data types in C language
Data types in C languageData types in C language
Data types in C language
 
Java basic datatypes
Java basic datatypesJava basic datatypes
Java basic datatypes
 
Constant a,variables and data types
Constant a,variables and data typesConstant a,variables and data types
Constant a,variables and data types
 
DATATYPE IN C# CSHARP.net
DATATYPE IN C# CSHARP.netDATATYPE IN C# CSHARP.net
DATATYPE IN C# CSHARP.net
 
ITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in java
 

Similar to Data types - brainsmartlabs

Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netKeywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netJaya Kumari
 
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
 
variablesfinal-170820055428 data type results
variablesfinal-170820055428 data type resultsvariablesfinal-170820055428 data type results
variablesfinal-170820055428 data type resultsatifmugheesv
 
02 Primitive data types and variables
02 Primitive data types and variables02 Primitive data types and variables
02 Primitive data types and variablesmaznabili
 
02. Primitive Data Types and Variables
02. Primitive Data Types and Variables02. Primitive Data Types and Variables
02. Primitive Data Types and VariablesIntro C# Book
 
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
 
data types in C-Sharp (C#)
data types in C-Sharp (C#)data types in C-Sharp (C#)
data types in C-Sharp (C#)Abid Kohistani
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingAbha Damani
 
java programming basics - part ii
 java programming basics - part ii java programming basics - part ii
java programming basics - part iijyoti_lakhani
 
03 and 04 .Operators, Expressions, working with the console and conditional s...
03 and 04 .Operators, Expressions, working with the console and conditional s...03 and 04 .Operators, Expressions, working with the console and conditional s...
03 and 04 .Operators, Expressions, working with the console and conditional s...Intro C# Book
 
CIS 1403 Lab 2- Data Types and Variables
CIS 1403 Lab 2- Data Types and VariablesCIS 1403 Lab 2- Data Types and Variables
CIS 1403 Lab 2- Data Types and VariablesHamad Odhabi
 

Similar to Data types - brainsmartlabs (20)

JAVA LESSON-01.pptx
JAVA LESSON-01.pptxJAVA LESSON-01.pptx
JAVA LESSON-01.pptx
 
Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netKeywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.net
 
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++
 
variablesfinal-170820055428 data type results
variablesfinal-170820055428 data type resultsvariablesfinal-170820055428 data type results
variablesfinal-170820055428 data type results
 
02 Primitive data types and variables
02 Primitive data types and variables02 Primitive data types and variables
02 Primitive data types and variables
 
02. Primitive Data Types and Variables
02. Primitive Data Types and Variables02. Primitive Data Types and Variables
02. Primitive Data Types and Variables
 
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++
 
data types in C-Sharp (C#)
data types in C-Sharp (C#)data types in C-Sharp (C#)
data types in C-Sharp (C#)
 
Java - Basic Datatypes.pptx
Java - Basic Datatypes.pptxJava - Basic Datatypes.pptx
Java - Basic Datatypes.pptx
 
C#
C#C#
C#
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
 
C# basics
C# basicsC# basics
C# basics
 
Chapter03
Chapter03Chapter03
Chapter03
 
C++ data types
C++ data typesC++ data types
C++ data types
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
java programming basics - part ii
 java programming basics - part ii java programming basics - part ii
java programming basics - part ii
 
Data Handling
Data HandlingData Handling
Data Handling
 
03 and 04 .Operators, Expressions, working with the console and conditional s...
03 and 04 .Operators, Expressions, working with the console and conditional s...03 and 04 .Operators, Expressions, working with the console and conditional s...
03 and 04 .Operators, Expressions, working with the console and conditional s...
 
CIS 1403 Lab 2- Data Types and Variables
CIS 1403 Lab 2- Data Types and VariablesCIS 1403 Lab 2- Data Types and Variables
CIS 1403 Lab 2- Data Types and Variables
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Recently uploaded (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

Data types - brainsmartlabs

  • 1. Visit our website for free course @ https://www.brainsmartlabs.com/free-basics Data Types In Java
  • 2. INDEX 01 02 03 04 Introduction to Brainsmartlabs What is data type in Java? Data types with examples Contact us
  • 3. Welcome!! We are providing the best Java and SQL tutorial videos for beginners who want to learn Java in detail. Here we are explained data types which is a part of java course. Kindly visit our website and watch our videos for more info @ https://www.brainsmartlabs.com/
  • 4. What is data type? In computer programming, a data type is an attribute of data which indicates the compiler or interpreter how the programmer expects to use the data. There are three types: 1. Primitive types  byte, short, int, long, float, double, char 2. Derived types  Arrays 3. User-defined types  class, sub class, abstract class, interface, enumeration and annotation.
  • 5. Primitive Data Types Primitive data types Numeric Types Non-Numeric Types Integer Types (Whole numbers) Floating Point Types (Decimal numbers) • Byte – 8 bit • short – 16 bit • int – 32 bit • long – 64 bit • float – 32 bit • double – 64 bit Char 8bit Boolean True - or- false
  • 6. Numeric Types The numeric types has divided into two types. Integer types: Positive, negative, Whole numbers and without decimal Floating point types: With decimal, numbers with fractional part
  • 7. Integer Types Byte: The byte is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127. For Example: byte myNum = 120; System.out.println(myNum); Short: It can store whole numbers from -32768 to 32767. For Example: short myNum = 5002; System.out.println(myNum);
  • 8. Integer Types int: It can store whole numbers from -2147483648 to 2147483647. For Example: int myNum = 200000; System.out.println(myNum); long: The long data type can store whole numbers from -9223372036854775 808 to 9223372036854775808. For Example: long myNum = 20000000000L; System.out.println(myNum);
  • 9. Floating Point Types float: It can store fractional numbers from 3.4e−038 to 3.4e+038. Should end with “f”. For Example: float myNum = 3.75f; System.out.println(myNum); Double: The double data type can store fractional numbers from 1.7e−308 to 1.7e+038. Should end with “d”. For Example: double myNum = 17.99d; System.out.println(myNum);
  • 10. Non Primitive DataTypes Booleans: A Boolean data type is declared with the boolean keyword. It only t akes the values true or false. For Example: boolean iscat = true; boolean isFish = false; System.out.println(iscat); System.out.println(isFishTasty);
  • 11. Non Primitive Data Types char: It is used to store a single character. A char value must be enclosed by single quotes, like 'A' or 'B'. For Example: char myGrade = 'C'; System.out.println(myGrade);
  • 12. Who we are? Brainsmartlabs.com is one of the best online platform where easily can learn Java and SQL courses online for free. Here you will learn the free basics first and then get into the core subject of Java and SQL language. Brain Smart Labs is one such platform which makes learning easier and affordable with n number of videos for free and paid. Our videos will not make you bored as our trainer follows a unique way of teaching with tasks, DIY, tricky questions for each and very videos. Also, SQL and Java beginners can start their tutorials from the basic with free videos. You can easily start your advanced SQL tutorial with examples with us.
  • 13. Contact Us support@brainsmartlabs.com (+91) 80958 38383 https://www.brainsmartlabs.com/