SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Data types and Literals




                          1
Objectives

On completion of this period, you would be able to
 know

•   Data types in Java
•   Literals in Java




                                                     2
Recap


In the previous class we have discussed
   •   White spaces, separators, literals and keywords
   •   Comments in Java




                                                         3
Data types in Java
• Data types in Java are classified into
   • Primitive types
   • Non-primitive types
• Primitive types are also known as simple data
  types
• A primitive type is predefined by the language
• Primitive types are further classified into
   • Numeric types
   • Non-numeric types



                                               4
Data types in Java
• Non-primitive types are also known as reference
  types
• Non-primitive types are
  • Classes
  • Interfaces
  • Arrays




                                                5
The classification of data types in Java
                             Data types in Java



             Primitive                         Non-primitive

 Numeric         Non-numeric
                                            classe            Arrays
                                            s
 integer
                      char                        Interface

Floating point             Boolea
                           n
                         Fig. 6.1 Data types in Java
                                                                  6
Data types

•   Primitive Java data types can be grouped into
    •   integers
    •   floating point numbers
    •   characters
    •   boolean




                                                    7
Integer types

•   Java defines four integer types: byte, short, int and
    long
•   All these are signed, positive and negative values
•   Java does not support unsigned types
•   byte is 8 bit width , short is 16 bit width int is 32
    bit width and long is 64 bit width



                                                            8
byte type

•   The smallest type is byte
•   Range from -128 to +128
•   Byte variables are declared by use of keyword
    ‘byte ‘
     eg.
         byte x, y;




                                                    9
short type

•  short is a signed 16 bit type.
• Its range is from -32,768 to +32,767

• It is probably the least used data type in Java

• Keyword used is ‘short’

eg.
  short x;




                                                    10
int type

•     The most commonly used integer data type is int
•     It has a range of -2,147,483,648 to 2,147,483,647
•     Keyword used is ‘int’
eg.
    int x;




                                                     11
long type
•   long is a signed 64 bit type
•   Useful where an int type is not large enough to hold
    the desired value
•   The range of large is quite large
•   This makes it useful when large, whole numbers are
    needed
•   Keyword used is ‘long’
eg. :
    long seconds;
                                                      12
floating point types

•   floating point numbers are also known as real
    numbers
•   Are used when fractional components are required
•   float and double are two kinds of floating point
    types
•   Keywords used are ‘float’ and ‘double’


                                                       13
Float type

•   float specify a single precision value that uses 32
    bits of storage
•   float type is useful when you require fractional
    component, but does not require a large degree of
    precision
eg.
    float area;

                                                          14
double type

•   double uses 64 bits of storage
•   When you need to maintain accuracy over many
    iterative calculations or manipulating large valued
    numbers double is the best choice
eg. :
    double area;


                                                      15
character type

•   In Java the data type used to store character is char
•   char in Java is different from char in C and C++
•   Java used Unicode to represent characters
•   Unicode was selected because it would help in
    internationalization of Java as a programming
    language
•   Java character is 16 bit type. The range of the
    characters is 0 to 65,536


                                                       16
boolean type

•   boolean data type is used to represent logical
    values that can be either true or false
•   All relational, conditional and logical operators
    return boolean values
•   It used only one bit of storage
•   Keyword used is ‘boolean’
•   eg;.
    •   boolean flag;



                                                        17
The simple data types in Java
•   In summary Java defines eight simple types of
    data. They are
    •   byte
    •   short
    •   int
    •   long
    •   char
    •   float
    •   double
    •   boolean

                                                    18
Summary
•   In this class we have discussed
    •   Data types in Java
    •   Literals in Java




                                      19
Quiz
1.Which of the following data type can store only
   two values
a)   int
b)   float
c)   boolean
d)   All of the above


                                                    20
Quiz

2.String Literal Enclosed with

a)   ‘‘
b)   ““
c)   **
d)   All the Above



                                 21
Frequently Asked Questions

1.   List the different data types available in Java

2.   Explain the various data types available in Java

3.   List the Literal in Java

4.   Explain the Literals in Java



                                                       22

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Control structures in java
Control structures in javaControl structures in java
Control structures in java
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Array in Java
Array in JavaArray in Java
Array in Java
 
History of java'
History of java'History of java'
History of java'
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
 
Java multi threading
Java multi threadingJava multi threading
Java multi threading
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
Java swing
Java swingJava swing
Java swing
 
Java threads
Java threadsJava threads
Java threads
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 
Features of java
Features of javaFeatures of java
Features of java
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 
Generics
GenericsGenerics
Generics
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
 
Functions in javascript
Functions in javascriptFunctions in javascript
Functions in javascript
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 

Ähnlich wie Java Data Types and Literals

Java Data Types and Variables
Java Data Types and VariablesJava Data Types and Variables
Java Data Types and Variablessasi saseenthiran
 
01 Java Language And OOP PART I
01 Java Language And OOP PART I01 Java Language And OOP PART I
01 Java Language And OOP PART IHari Christian
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variablesteach4uin
 
332 ch07
332 ch07332 ch07
332 ch07YaQ10
 
Java basic data types
Java basic data typesJava basic data types
Java basic data typesjavaicon
 
Java basic data types
Java basic data typesJava basic data types
Java basic data types3trg
 
demo1 java of demo 1 java with demo 1 java.ppt
demo1 java of demo 1 java with demo 1 java.pptdemo1 java of demo 1 java with demo 1 java.ppt
demo1 java of demo 1 java with demo 1 java.pptFerdieBalang
 
Data types in Java
Data types in JavaData types in Java
Data types in JavaPlay Store
 
Mesics lecture 3 c – constants and variables
Mesics lecture 3   c – constants and variablesMesics lecture 3   c – constants and variables
Mesics lecture 3 c – constants and variableseShikshak
 
Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm Madishetty Prathibha
 

Ähnlich wie Java Data Types and Literals (20)

Data types IN JAVA
Data types IN JAVAData types IN JAVA
Data types IN JAVA
 
Java Data Types and Variables
Java Data Types and VariablesJava Data Types and Variables
Java Data Types and Variables
 
01 Java Language And OOP PART I
01 Java Language And OOP PART I01 Java Language And OOP PART I
01 Java Language And OOP PART I
 
Variable
VariableVariable
Variable
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variables
 
332 ch07
332 ch07332 ch07
332 ch07
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
ITFT - Java
ITFT - JavaITFT - Java
ITFT - Java
 
Java basic-data-types
Java basic-data-typesJava basic-data-types
Java basic-data-types
 
Java basic data types
Java basic data typesJava basic data types
Java basic data types
 
Java basic data types
Java basic data typesJava basic data types
Java basic data types
 
demo1 java of demo 1 java with demo 1 java.ppt
demo1 java of demo 1 java with demo 1 java.pptdemo1 java of demo 1 java with demo 1 java.ppt
demo1 java of demo 1 java with demo 1 java.ppt
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
 
Datatype
DatatypeDatatype
Datatype
 
Data types in Java
Data types in JavaData types in Java
Data types in Java
 
Java Datatypes
Java DatatypesJava Datatypes
Java Datatypes
 
Java session3
Java session3Java session3
Java session3
 
basics dart.pdf
basics dart.pdfbasics dart.pdf
basics dart.pdf
 
Mesics lecture 3 c – constants and variables
Mesics lecture 3   c – constants and variablesMesics lecture 3   c – constants and variables
Mesics lecture 3 c – constants and variables
 
Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm
 

Mehr von myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Kürzlich hochgeladen

Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 

Kürzlich hochgeladen (20)

Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 

Java Data Types and Literals

  • 1. Data types and Literals 1
  • 2. Objectives On completion of this period, you would be able to know • Data types in Java • Literals in Java 2
  • 3. Recap In the previous class we have discussed • White spaces, separators, literals and keywords • Comments in Java 3
  • 4. Data types in Java • Data types in Java are classified into • Primitive types • Non-primitive types • Primitive types are also known as simple data types • A primitive type is predefined by the language • Primitive types are further classified into • Numeric types • Non-numeric types 4
  • 5. Data types in Java • Non-primitive types are also known as reference types • Non-primitive types are • Classes • Interfaces • Arrays 5
  • 6. The classification of data types in Java Data types in Java Primitive Non-primitive Numeric Non-numeric classe Arrays s integer char Interface Floating point Boolea n Fig. 6.1 Data types in Java 6
  • 7. Data types • Primitive Java data types can be grouped into • integers • floating point numbers • characters • boolean 7
  • 8. Integer types • Java defines four integer types: byte, short, int and long • All these are signed, positive and negative values • Java does not support unsigned types • byte is 8 bit width , short is 16 bit width int is 32 bit width and long is 64 bit width 8
  • 9. byte type • The smallest type is byte • Range from -128 to +128 • Byte variables are declared by use of keyword ‘byte ‘ eg. byte x, y; 9
  • 10. short type • short is a signed 16 bit type. • Its range is from -32,768 to +32,767 • It is probably the least used data type in Java • Keyword used is ‘short’ eg. short x; 10
  • 11. int type • The most commonly used integer data type is int • It has a range of -2,147,483,648 to 2,147,483,647 • Keyword used is ‘int’ eg. int x; 11
  • 12. long type • long is a signed 64 bit type • Useful where an int type is not large enough to hold the desired value • The range of large is quite large • This makes it useful when large, whole numbers are needed • Keyword used is ‘long’ eg. : long seconds; 12
  • 13. floating point types • floating point numbers are also known as real numbers • Are used when fractional components are required • float and double are two kinds of floating point types • Keywords used are ‘float’ and ‘double’ 13
  • 14. Float type • float specify a single precision value that uses 32 bits of storage • float type is useful when you require fractional component, but does not require a large degree of precision eg. float area; 14
  • 15. double type • double uses 64 bits of storage • When you need to maintain accuracy over many iterative calculations or manipulating large valued numbers double is the best choice eg. : double area; 15
  • 16. character type • In Java the data type used to store character is char • char in Java is different from char in C and C++ • Java used Unicode to represent characters • Unicode was selected because it would help in internationalization of Java as a programming language • Java character is 16 bit type. The range of the characters is 0 to 65,536 16
  • 17. boolean type • boolean data type is used to represent logical values that can be either true or false • All relational, conditional and logical operators return boolean values • It used only one bit of storage • Keyword used is ‘boolean’ • eg;. • boolean flag; 17
  • 18. The simple data types in Java • In summary Java defines eight simple types of data. They are • byte • short • int • long • char • float • double • boolean 18
  • 19. Summary • In this class we have discussed • Data types in Java • Literals in Java 19
  • 20. Quiz 1.Which of the following data type can store only two values a) int b) float c) boolean d) All of the above 20
  • 21. Quiz 2.String Literal Enclosed with a) ‘‘ b) ““ c) ** d) All the Above 21
  • 22. Frequently Asked Questions 1. List the different data types available in Java 2. Explain the various data types available in Java 3. List the Literal in Java 4. Explain the Literals in Java 22