SlideShare une entreprise Scribd logo
1  sur  9
Data Types & Variables DhrubojyotiKayal
What are data types? Data types in Java Variables Literals Agenda
classification identifying one of various types of data They have special features and requirements Perform operations on data They need memory What are data types?
8 primitive data types, all signed (+,-) Irrespective of environment the data types have same size Data types in Java
Variables/Fields stores values with specific data type Instance variables (object fields) Class variables (static fields) Local variables (method fields) Parameters (arguments passed to a method) int age; long creditCardNumber;  Terminate with semi-colon or separate with comma int age, long creditCardNumber; Variables
Variable names are case-sensitive Unlimited length with letters and digits Begin with letter, ‘$’,’_’ Don’t use ‘$’ or ‘_’ Whitespace not allowed Subsequent characters may be letters, digits, dollar signs, or underscore characters Use meaningful names Use Camelian Notation intcreditCardNumber; Variable naming
Fixed values assigned to variables without computation int age = 32; long creditCardNumber = 135353553566; Literals
Write a simple Java program and declare 3 variables – your age (integer), your credit card number(long), and your bank balance(double) Assign literal values to these fields Print the 3 values in console Exercise
Q&A

Contenu connexe

Tendances

D I T211 Chapter 3
D I T211    Chapter 3D I T211    Chapter 3
D I T211 Chapter 3askme
 
Dbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelDbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelAmiya9439793168
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systemsTaher Barodawala
 
Dbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design IssueDbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design IssueAmiya9439793168
 
Data modelingpresentation
Data modelingpresentationData modelingpresentation
Data modelingpresentationfikirabc
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistencePrem Lamsal
 
Conceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-modelsConceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-modelsShailaja Jayaprakash
 
01 Persistence And Orm
01 Persistence And Orm01 Persistence And Orm
01 Persistence And OrmRanjan Kumar
 
S6 advanced issues in erd pdf
S6 advanced issues in erd pdfS6 advanced issues in erd pdf
S6 advanced issues in erd pdfaviy1966
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 
Introduction of Database Design and Development
Introduction of Database Design and DevelopmentIntroduction of Database Design and Development
Introduction of Database Design and DevelopmentEr. Nawaraj Bhandari
 
Pemrograman komputer 5 (selectioni)
Pemrograman komputer 5 (selectioni)Pemrograman komputer 5 (selectioni)
Pemrograman komputer 5 (selectioni)jayamartha
 

Tendances (20)

7.data types in c#
7.data types in c#7.data types in c#
7.data types in c#
 
D I T211 Chapter 3
D I T211    Chapter 3D I T211    Chapter 3
D I T211 Chapter 3
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
Dbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelDbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational Model
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systems
 
Dbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design IssueDbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design Issue
 
Data modelingpresentation
Data modelingpresentationData modelingpresentation
Data modelingpresentation
 
Er Modeling
Er ModelingEr Modeling
Er Modeling
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistence
 
Conceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-modelsConceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-models
 
01 Persistence And Orm
01 Persistence And Orm01 Persistence And Orm
01 Persistence And Orm
 
Relational Model
Relational ModelRelational Model
Relational Model
 
Types of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal GulatiTypes of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal Gulati
 
S6 advanced issues in erd pdf
S6 advanced issues in erd pdfS6 advanced issues in erd pdf
S6 advanced issues in erd pdf
 
CIS266 Midterm Review
CIS266 Midterm ReviewCIS266 Midterm Review
CIS266 Midterm Review
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
Introduction of Database Design and Development
Introduction of Database Design and DevelopmentIntroduction of Database Design and Development
Introduction of Database Design and Development
 
Pemrograman komputer 5 (selectioni)
Pemrograman komputer 5 (selectioni)Pemrograman komputer 5 (selectioni)
Pemrograman komputer 5 (selectioni)
 
Data modeling
Data modelingData modeling
Data modeling
 
Object oriented databases
Object oriented databasesObject oriented databases
Object oriented databases
 

En vedette

Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...Cloudera, Inc.
 
DMDW Lesson 04 - Data Mining Theory
DMDW Lesson 04 - Data Mining TheoryDMDW Lesson 04 - Data Mining Theory
DMDW Lesson 04 - Data Mining TheoryJohannes Hoppe
 
04 Classification in Data Mining
04 Classification in Data Mining04 Classification in Data Mining
04 Classification in Data MiningValerii Klymchuk
 
2.3 bayesian classification
2.3 bayesian classification2.3 bayesian classification
2.3 bayesian classificationKrish_ver2
 
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & KamberChapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kambererror007
 
Bayesian classification
Bayesian classificationBayesian classification
Bayesian classificationManu Chandel
 
Machine Learning and Data Mining: 13 Nearest Neighbor and Bayesian Classifiers
Machine Learning and Data Mining: 13 Nearest Neighbor and Bayesian ClassifiersMachine Learning and Data Mining: 13 Nearest Neighbor and Bayesian Classifiers
Machine Learning and Data Mining: 13 Nearest Neighbor and Bayesian ClassifiersPier Luca Lanzi
 
Data Mining: Concepts and techniques classification _chapter 9 :advanced methods
Data Mining: Concepts and techniques classification _chapter 9 :advanced methodsData Mining: Concepts and techniques classification _chapter 9 :advanced methods
Data Mining: Concepts and techniques classification _chapter 9 :advanced methodsSalah Amean
 
Belief Networks & Bayesian Classification
Belief Networks & Bayesian ClassificationBelief Networks & Bayesian Classification
Belief Networks & Bayesian ClassificationAdnan Masood
 
04 theories and classification of retailing
04 theories and classification of retailing04 theories and classification of retailing
04 theories and classification of retailingDr. Chandan Vichoray
 
Data mining: Classification and prediction
Data mining: Classification and predictionData mining: Classification and prediction
Data mining: Classification and predictionDataminingTools Inc
 

En vedette (14)

04 data mining : data generelization
04 data mining : data generelization04 data mining : data generelization
04 data mining : data generelization
 
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...
 
DMDW Lesson 04 - Data Mining Theory
DMDW Lesson 04 - Data Mining TheoryDMDW Lesson 04 - Data Mining Theory
DMDW Lesson 04 - Data Mining Theory
 
04 Classification in Data Mining
04 Classification in Data Mining04 Classification in Data Mining
04 Classification in Data Mining
 
Lecture 04 data resource management
Lecture 04 data resource managementLecture 04 data resource management
Lecture 04 data resource management
 
2.3 bayesian classification
2.3 bayesian classification2.3 bayesian classification
2.3 bayesian classification
 
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & KamberChapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
 
Bayesian classification
Bayesian classificationBayesian classification
Bayesian classification
 
Machine Learning and Data Mining: 13 Nearest Neighbor and Bayesian Classifiers
Machine Learning and Data Mining: 13 Nearest Neighbor and Bayesian ClassifiersMachine Learning and Data Mining: 13 Nearest Neighbor and Bayesian Classifiers
Machine Learning and Data Mining: 13 Nearest Neighbor and Bayesian Classifiers
 
Data Mining: Concepts and techniques classification _chapter 9 :advanced methods
Data Mining: Concepts and techniques classification _chapter 9 :advanced methodsData Mining: Concepts and techniques classification _chapter 9 :advanced methods
Data Mining: Concepts and techniques classification _chapter 9 :advanced methods
 
Belief Networks & Bayesian Classification
Belief Networks & Bayesian ClassificationBelief Networks & Bayesian Classification
Belief Networks & Bayesian Classification
 
04 theories and classification of retailing
04 theories and classification of retailing04 theories and classification of retailing
04 theories and classification of retailing
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
 
Data mining: Classification and prediction
Data mining: Classification and predictionData mining: Classification and prediction
Data mining: Classification and prediction
 

Similaire à Data Types Variables Literals Java

PLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptxPLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptxMattFlordeliza1
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-cteach4uin
 
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
 
Data Types and variables in C++.pptx
Data Types and variables in C++.pptxData Types and variables in C++.pptx
Data Types and variables in C++.pptxjamilmalik19
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and OperatorsMarwa Ali Eissa
 
C Language presentation
C Language presentationC Language presentation
C Language presentationRupanshi rawat
 

Similaire à Data Types Variables Literals Java (10)

PLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptxPLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptx
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Basic
BasicBasic
Basic
 
Lec2.pptx
Lec2.pptxLec2.pptx
Lec2.pptx
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 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++
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
 
Data Types and variables in C++.pptx
Data Types and variables in C++.pptxData Types and variables in C++.pptx
Data Types and variables in C++.pptx
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
 
C Language presentation
C Language presentationC Language presentation
C Language presentation
 

Plus de dhrubo kayal

Plus de dhrubo kayal (20)

Cipla 20-09-2010
Cipla   20-09-2010Cipla   20-09-2010
Cipla 20-09-2010
 
01 session tracking
01   session tracking01   session tracking
01 session tracking
 
03 handling requests
03 handling requests03 handling requests
03 handling requests
 
02 up close with servlets
02 up close with servlets02 up close with servlets
02 up close with servlets
 
01 overview-servlets-and-environment-setup
01 overview-servlets-and-environment-setup01 overview-servlets-and-environment-setup
01 overview-servlets-and-environment-setup
 
19 reflection
19   reflection19   reflection
19 reflection
 
18 concurrency
18   concurrency18   concurrency
18 concurrency
 
17 exceptions
17   exceptions17   exceptions
17 exceptions
 
16 containers
16   containers16   containers
16 containers
 
15 interfaces
15   interfaces15   interfaces
15 interfaces
 
14 initialization & cleanup
14   initialization & cleanup14   initialization & cleanup
14 initialization & cleanup
 
13 inheritance
13   inheritance13   inheritance
13 inheritance
 
12 encapsulation
12   encapsulation12   encapsulation
12 encapsulation
 
11 static
11   static11   static
11 static
 
10 access control
10   access control10   access control
10 access control
 
09 packages
09   packages09   packages
09 packages
 
08 class and object
08   class and object08   class and object
08 class and object
 
07 flow control
07   flow control07   flow control
07 flow control
 
05 operators
05   operators05   operators
05 operators
 
03 hello world with java
03   hello world with java03   hello world with java
03 hello world with java
 

Data Types Variables Literals Java

  • 1. Data Types & Variables DhrubojyotiKayal
  • 2. What are data types? Data types in Java Variables Literals Agenda
  • 3. classification identifying one of various types of data They have special features and requirements Perform operations on data They need memory What are data types?
  • 4. 8 primitive data types, all signed (+,-) Irrespective of environment the data types have same size Data types in Java
  • 5. Variables/Fields stores values with specific data type Instance variables (object fields) Class variables (static fields) Local variables (method fields) Parameters (arguments passed to a method) int age; long creditCardNumber; Terminate with semi-colon or separate with comma int age, long creditCardNumber; Variables
  • 6. Variable names are case-sensitive Unlimited length with letters and digits Begin with letter, ‘$’,’_’ Don’t use ‘$’ or ‘_’ Whitespace not allowed Subsequent characters may be letters, digits, dollar signs, or underscore characters Use meaningful names Use Camelian Notation intcreditCardNumber; Variable naming
  • 7. Fixed values assigned to variables without computation int age = 32; long creditCardNumber = 135353553566; Literals
  • 8. Write a simple Java program and declare 3 variables – your age (integer), your credit card number(long), and your bank balance(double) Assign literal values to these fields Print the 3 values in console Exercise
  • 9. Q&A